OutBound Rest Message with a attachment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2016 01:33 PM
Hey guys,
I need to send ServiceNow attachments from the business rule when a record is inserted
Use case : if new incident with attachment is created, business rule needs to grab the attachment and post it to 3rd party endpoint
endpoint looks like this
curl ########################### \
-H "Authorization: Bearer ACCESS_TOKEN" -X POST \
-F attributes='{"name":"#######", "parent":{"id":"########"}}' \
-F file=@myfile.jpg
can this be achieved with outbound rest message ?
any help is really appreciated
regards
NB
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2017 12:49 AM
Hi Nagendra,
I'll suggest you use the GlideSysAttachment API.
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2017 12:52 AM
The following blog should also be helpful:
Reading Attachments Using ServiceNow GlideSysAttachment API
Thanks,
Berny

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2017 03:41 PM
I have struggled with this for far too long (using GlideSysAttachment() and other methods) until I got the correct answer one day from josh.nerius in the SNDevs Slack channel...
Docs article: RESTMessageV2 - setRequestBodyFromAttachment(String attachmentSysId)
This single line added to your scripted outbound REST message will download the attachment into your request body before sending it to the remote endpoint.
Enjoy!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2017 08:37 PM
The slack channel mentioned above is run by whom?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2017 08:11 AM
It's run by a group of active developers/architects (not officially run by SN Inc.). There are a bunch of very active members, and over 1700 total registered members.
Check out https://sndevs.com for an invite and join us.