Attachment REST API

Harika Bhupathi
Giga Guru

Hello community,

How can we send base64 encoded file using Attachment API?

I have used binary present in Body  using POSTMAN and REST API Explorer by selecting a file. it worked fine.

But we need to achieve it by sending a base64 encode into the servicenow using Attachment API.

When I tried a docx file encoded Base64 in body content, the file got attached to incident but when tried to open the attachment, got an error stating 'contents are invalid'.

 

2 REPLIES 2

asifnoor
Kilo Patron

Hi,

Before uploading the attachment you need to decode and then write the attachment file. If you have to send the attachment to any 3rd party then you shall use base 64 encoding.

https://community.servicenow.com/community?id=community_question&sys_id=cd48f944dbd327801089e15b8a96...

Mark the comment as a correct answer and also helpful once worked.