Looking for Attachment API and sample payload details for 3rd party tool to send attachments to SN
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2025 06:40 AM
There is an external 3rd party tool which creates incidents in ServiceNow. We have shared the scripted end point.
But now need to share the API details for Attachment, along with sample payload.
I shared below,
https://xxxxx.service-now.com/api/now/attachment/file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2025 07:56 AM - edited 06-01-2025 07:57 AM
Hi @Suggy
as you can see on https://www.servicenow.com/docs/bundle/yokohama-api-reference/page/integrate/inbound-rest/concept/c_...
a typical CURL command for the upload could look like this:
curl "https://instance.servicenow.com/api/now/attachment/file?table_name=incident&table_sys_id=d71f7935c0a8016700802b64c67c11c6&file_name=Issue_screenshot" \
--request POST \
--header "Accept:application/json" \
--header "Content-Type: image/jpeg" \
--user "username":"password" \
--data-binary "@ location of the file on file system"
So the content of the request body must contain the binary data of the file to be sent.
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2025 08:07 AM
@Suggy ,
Check the below:
How to Make REST Attachment API Requests
send the attachment from postman tool to servicenow
Mark this as Helpful / Accept the Solution if this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2025 06:26 PM
@Maik Skoddow @SN_Learn Thanks for replying. Can you share the sample java script payload containing the attachment file details in the payload.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2025 07:15 PM
Hi @Suggy
I already explained that the payload is nothing else than the binary content of the file. And this cannot be given as an example because binary data cannot be printed in a plain text field.
Maik