Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Handling Binary Attachments

Khozema Attar1
Tera Guru

Hi ,

We are performing a third-party integration using REST.

I am using POSTMAN and created a request to send attachments in binary format. Content field contains the binary coding of the file I am trying to attach.Below is the screenshot of POSTMAN request

find_real_file.png

The file gets attached to the incident, but it is not converted back to the image ,instead the file shows the Binary Encoding. Find the below Screenshot:

find_real_file.png

Can anyone suggest where the request is going wong.

Also, need to know how attachments in Binary format, sent to ServiceNow is Handled?

Any suggestions will be deeply appreciated.

Thanks,

1 ACCEPTED SOLUTION

Hi khozema,



I found a small error in postman request, you need not to give   binary content manually just select the binary option and upload the file, it will be automatically converted into binary and do not forget to give Content Type.. it is not mandatory but is a good practice.



screenshot


acattach.png



Thanks


Neeraj sharma



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Khozema,



Can you add Content-type as image/jpeg in the header and try it once.



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,



It isn't working!



Are there any articles or links which can guide on how the attachments are handled through REST in ServiceNow, like how to decode the attachments and other things.


If you can please share some links and docs ,it will be helpful.



Thanks ,


Hi khozema,



I found a small error in postman request, you need not to give   binary content manually just select the binary option and upload the file, it will be automatically converted into binary and do not forget to give Content Type.. it is not mandatory but is a good practice.



screenshot


acattach.png



Thanks


Neeraj sharma



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Hi neeraj,



I tested it with the changes you suggested and it works fine




Thanks,