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.

Send Binary Attachment Data via REST Message

GargiO
Tera Contributor

Hello All,

 

We are looking for a way to send "Binary" attachment data out to ServiceNow via REST Message, we donot want to encode the Data.

 

Regards,

Gargi Ojha

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@GargiO 

you can use setRequestBodyFromAttachment() method of RESTMessageV2

https://developer.servicenow.com/dev.do#!/reference/api/yokohama/server/sn_ws-namespace/c_RESTMessag... 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

3 REPLIES 3

GargiO
Tera Contributor

This solution sends the attachment in base64 encoded format. We need to send the data in binary(bytes) format. 

Ankur Bawiskar
Tera Patron
Tera Patron

@GargiO 

you can use setRequestBodyFromAttachment() method of RESTMessageV2

https://developer.servicenow.com/dev.do#!/reference/api/yokohama/server/sn_ws-namespace/c_RESTMessag... 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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