GET REST Attachment (Excel) from Third party to Service Now

sowmyaa
Tera Guru

Hi All,

I am kind of struck in this. Any help will be appreciated!!

I have REST url of a third party tool which will get me an excel sheet. I tested this URL in POSTMAN it is working fine. But how can i call this URL in ServiceNow to get the excel sheet and import the record which can intern fill a table in service now. I tried configuring REST Outbound message , but it gives me 500 error. But same configuration works fine in POSTMAN.

Can any one suggest how to deal with this?

Appreciate your inputs !

Thank you

Sowmya

1 ACCEPTED SOLUTION

sowmyaa
Tera Guru

Hi Ankur,



Thank you. I was able to resolve the issue. REST configuration was correct. Servicenow was looking for one way authentication. I downloaded the certificate of that third party and uploaded to Service Now. It worked like a charm !!!



Cheers,


Sowmya


View solution in original post

9 REPLIES 9

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Sowmya,



Create REST message. Set the endpoint.


Use appropriate method for this and run the script in background.



I assume you want to fetch xls file from third party through api and want to load the data from that?


Is this correct.



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

Thank you Ankur. Thats exactly i want to do. I have done all the steps mentioned by you. But when i run it, i get 0 as httpStatus. But if i run the same in POSTMAN it works just fine. Not sure what is wrong?


Hi Sowmya,



What details are you getting in the api response in postman?


the content of the excel file.


Did you configure the headers, authentication etc proper in servicenow.



Can you post screenshot for postman and rest message both?



Regards


Ankur


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

I have configured below headers in POSTMAN


URL :


Method : GET


Content-Type   : text/plain


Accept : text/plain


Authorization : Bearer + "generated token Here"



In service now ,


1. I configured a OUTBound REST Message with the above URL


2. I copied the script to script include


3. Set headers for content type, accept, authorization in code


4. Also called method "saveResponseBodyAsAttatchment()



But i get httpstatus as 0



I can share the screen shot after some time. But i am doing above steps. Am i missing anything here