Download file from a 3rd Party system using REST in ServiceNow

Sal12
Tera Expert

Background details

I want to download a file from a third party file server.  It can store files of all types.

Their API only accepts data in the Header (Content-Type and DNT) and the Body comprises of form-data, the form data is some sort of key value pair (nothing more nothing less).

So, I have everything in place and when I send the request using Postman I get a 200 OK response and response body is empty. The response body is empty because that's how their API is designed to work. They do not send any response back, just a status code of 200 OK.

If I want to download the file then I click on Send and Download from Postman and that gives me an option to save the file on my local machine. So, until here all is good and I am having a good and sunny day.

Now, I have to do this integration in ServiceNow. So, I have all the things setup in an Outbound REST Message customization in my app. I used the Test Related Link UI action (the usual way to test the REST Method) to test this and I get a positive response, which 200 OK here as well, just like I got in Postman.

Need help with:

I would like to know what do I do now to download the file in case of ServiceNow?

2 REPLIES 2

Vikram Gupta
Tera Contributor

Hi @Sal12  I also have same requirement. Did you get solution for same

Mike Rakvica1
Tera Guru

If you use a custom REST action in flow designer it has an option to save the attachment. I would try doing it this way.