Send attachment data to external system using Rest API in JSON format.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2021 07:50 AM
Hi Team,
I need to send attachment data to external system in JSON format. How can I do it?
Should I also encode data to base64 in this case?
Please help me!
Thank You
- Labels:
-
Integrations
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2021 07:55 AM
Hi,
yes in most integrations the file attachment content is passed as base64Encoded data so that 3rd party can decode it at their side.
check these links for example
Business rule to send attachment to 3rd Party Tool via REST
Unable to send attachment via REST
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2021 08:08 AM
Thanks for your reply @Ankur Bawiskar.
So, can't we send data in JSON format?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2021 08:28 AM
yes inside the JSON request only you have to include the base64Encoded data
Example:
{
"file_name":"Resume.docx",
"content-type":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"base64Data":"base64EncodedData"
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2021 12:43 AM
Hi Ankur,
As per the new requirement, I want to send excel data in JSON format without encoding.
Thank You