How to send attachment files in base64 format?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2019 10:32 AM
Hi All,
We have integrated servicenow with service grid tool for case exchange purpose.
Can anyone please help me on how to send attachment files in base64 format from servicenow.
I have tried with all possibilities.
Following is my code that i am using for payload:
var sa = new GlideSysAttachment();
var StringUtil = Packages.com.glide.util.StringUtil;
//Get the base64 encoding of the attachment
var binData = sa.getBytes(current);
var encData = GlideStringUtil.base64Encode(binData);
var s = new sn_ws.SOAPMessageV2('soap_message', 'http_method');
s.setStringParameterNoEscape('Filename', current.file_name);
s.setStringParameterNoEscape('TaskNumber', current.table_name.number);
s.setStringParameterNoEscape('Payload', encData);
Seems not working!!
Please can any one help?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2019 10:46 AM
Hi Sri,
Does the 3rd party require base64encoded data?
are you sending it in proper xml tag?
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
‎07-19-2019 07:53 AM
Hi Sri,
Any update on this?
Can you mark my answer as correct, helpful if you were able to achieve the requirement. This helps in removing this question from unanswered list and helps users to learn from your thread. Thanks in advance.
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
‎07-19-2019 08:03 AM
Did you try with getContentBase64 method?
https://developer.servicenow.com/app.do#!/api_doc?v=london&id=r_SGSA-getContentBase64_GR
Thanks & Regards,
Vasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2020 08:35 AM
It seems this function works only in scoped application.