The CreatorCon Call for Content is officially open! Get started here.

Attachment API getting attachment content showing binary rather than image

Khalnayak
Kilo Sage

7 REPLIES 7

Hitoshi Ozawa
Giga Sage
Giga Sage

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.

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?

this is the error the third party is getting in the console of browser when using the get attachment request via power automate

and also shows the same binary result as rest api explorer displaysfind_real_file.png

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.