- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2018 02:54 AM
Hi Experts,
In Knowledge Management, I am trying to read the attachments. When I pull a dump in XML and try to decode the
attachments it works fine. But when I use the REST API and pull the attachments, I am not able to decode the file it
throws an error. When I try to compare the Base64 String in XML and REST API, both are different. Kindly let me know
how to get this issue resolved.
Thank you,
Sriram.
Solved! Go to Solution.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-11-2018 11:27 PM
Hi Sriram,
Yes the actual data resides in sys_attachment_doc but not as whole but in chunks; so you won't get complete set of data from that table from single record.
https://snprotips.com/blog/2016/2/25/understanding-and-using-glideattachment
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
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
‎11-09-2018 01:01 AM
Hi Sriram,
Are you saying that from your local machine you want to pick up file and add that as an attachment to some ticket/record in ServiceNow?
Or you are fetching attachment from ServiceNow table record in java?
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
‎11-09-2018 01:09 AM
Hi Ankur,
I am fetching/reading data from an Knowledge Article and trying to decrypt the data. But the Base64 string in XML is different from the one in REST API. when I try to decrypt it throws errors where as in XML it works fine.
Regards,
Sriram.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2018 02:35 AM
Hi Sriram,
So you are getting base64encoded data of attachment within ServiceNow
Are you trying to decode it within ServiceNow or java code?
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
‎11-09-2018 05:44 AM
Hi Ankur,
I am trying to decode in Java and it does not work. But the Base64 data from the XML dump decodes and works fine.
Unable to understand whether I am missing any thing.
Regards,
Sriram.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2018 06:10 AM
Hi Sriram,
So you are saying you are not able to decode the base64encoded data and cannot create a file using java code?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader