Attachment API getting attachment content showing binary rather than image
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2022 08:56 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2022 01:41 PM
The problem is on trying to display the result within the REST API Explorer which is text based.
Type the URL displayed in "HTTP Method / URI" directly in the web browser to see the image.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2022 01:02 AM
Hi Hitoshi,
entering the url directly in web browser downloads the file which is fine.
But my question is, when working with 3rd party system how can we retrieve the attachment from there?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2022 01:05 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2022 01:25 AM
That's probably because the third party is calling the REST API using text instead of binary.
To download an image as a text, need to convert the image to Base64 format.
The image can be downloaded using curl as a binary file. If calling from a script, how is it calling the ServiceNow API? It seems like it's calling with response format as application/xml.