Any idea of how to upload a binary file attachment from ServiceNow to Box with POST?

michellefast
Giga Contributor

I am trying to integrate ServiceNow with Box. I am able to upload a simple text file to Box via POST, but now I am trying to upload a PDF or a word document (binary files).

As far as I am aware, ServiceNow does not support binary data and encodes files in Base64 before posting it to Box. Box does not support Base64 encoding and requires binary data. I have also attempted to use setRequestBodyFromAttachment('attachment_sys_id') but that has been setting the request body as null.

Does anyone have any recommendations on other approaches or maybe I am missing something? I would prefer to avoid having to modify the MID servers.

Any help would be greatly appreciated.

1 ACCEPTED SOLUTION

bernyalvarado
Mega Sage

Hi Michelle,



The following should be helpful:


How to HTTP POST pure binary data to external system?



Thanks,


Berny


View solution in original post

2 REPLIES 2

bernyalvarado
Mega Sage

Hi Michelle,



The following should be helpful:


How to HTTP POST pure binary data to external system?



Thanks,


Berny


Aleksas Kucins1
Giga Expert

You can send binary attachments from ServiceNow to Box and other platforms with multipart, however it is pretty complicated. This article explains it:

https://servicenowthink.wordpress.com/2020/04/13/how-to-send-binary-data-with-multipart-from-service...