Get attachments through rest message
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 03:06 AM
Hi Team,
I want to get attachments from one instance to another instance through rest message.
For example: Incidents created on this week and if all tickets having an attachment then all attachments should be get in another instance through get method.
Can anyone help on this?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 03:22 AM
Hi,
The Attachment API is well documented here: https://docs.servicenow.com/en-US/bundle/tokyo-api-reference/page/integrate/inbound-rest/concept/c_A...
Regards,
Niklas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2023 11:34 PM
Scenario : I have one catalog item and there few attachments in those in RITM, I want to fetch only those through rest api.
Thanks,
Preethi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2023 11:52 PM
Hi,
You need to spend some time on the design on this. There are decisions that needs to be made. Like should you push the data from one instance to the other or do you want to pull. Do you want to run it scheduled or should you have the attachments sync as soon as they are added etc.
Have a look at the solution of this old community post for some inspiration.
https://www.servicenow.com/community/developer-forum/copying-attachment-from-one-instance-to-another...
Regards,
Niklas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Niklas. The documentation link is broken.
I think you should use this format:
r.setSaveResponseBodyAsAttachment(
'table',
current.sys_id,
'my_file.pdf'
);
Where r is an instance of RESTMessageV2 but I don´t broken me.
