How to send files from ServiceNow sys_attachment to an external API

Logappradeep
Tera Contributor

Hi everyone,
I want to send files stored in the sys_attachment table in ServiceNow to an external API that accepts file uploads (tested successfully using Postman as multipart/form-data).

I’m looking for guidance or sample code on:

  • Retrieving the file content from sys_attachment

  • Creating a multipart/form-data request using RESTMessageV2 or any alternative

  • Handling headers and file content correctly in the request

Has anyone done this or can share a working approach?
Thanks in advance for your help!

Thanks,
Logappradeep
3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@Logappradeep 

check these links

Multipart/form-data attachment pusg using Rest API from Snow->Jira 

Outbound REST - Multipart/form-data 

REST API attachments Transfer to JIRA 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

I'll confirm and get back to you.

Thanks,
Logappradeep

@Logappradeep 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader