- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-18-2022 03:24 PM
Hello Everyone,
I got third party applications which have cases. I used REST Message to the script and used in script include to pull the data at a scheduled time (using scheduled job). The issue I have here is attachments. So how attachments from third party get attached to cases(just created from rest api integration) in servicenow?
Solved! Go to Solution.
- Labels:
-
Integrations

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-18-2022 04:32 PM
Satish,
Attachments are saved in sys_attachment table and have a separate API to retrieve them.
Meta information on attachment is retrieved using the /now/attachment/{sys_id} API. {sys_id} here is the sys_id in the sys_attachment table.
https://developer.servicenow.com/dev.do#!/reference/api/rome/rest/c_AttachmentAPI#attachment-GET
To retrieve the content of an attachment, use the /now/attachment/{sys_id}/file
Following thread has a sample python script to download attachment.
Attachment APIs can be tested from REST API Explorer. To download the attachment content, use the "Retrieve attachment content (GET)" method. The generated sample code, also, doesn't contain content-type headers so the retrieved file may not come out correct. Be sure to add the content-type when downloading binary files.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-18-2022 04:03 PM
Hi Satish,
Take a look at https://developer.servicenow.com/dev.do#!/reference/api/rome/rest/c_AttachmentAPI, it should solve your attachment problems

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-18-2022 04:32 PM
Satish,
Attachments are saved in sys_attachment table and have a separate API to retrieve them.
Meta information on attachment is retrieved using the /now/attachment/{sys_id} API. {sys_id} here is the sys_id in the sys_attachment table.
https://developer.servicenow.com/dev.do#!/reference/api/rome/rest/c_AttachmentAPI#attachment-GET
To retrieve the content of an attachment, use the /now/attachment/{sys_id}/file
Following thread has a sample python script to download attachment.
Attachment APIs can be tested from REST API Explorer. To download the attachment content, use the "Retrieve attachment content (GET)" method. The generated sample code, also, doesn't contain content-type headers so the retrieved file may not come out correct. Be sure to add the content-type when downloading binary files.