How to create a REST API to download attachment?

Subhashree3
Giga Contributor

Hi All,

We have one requirement where we need to create a Rest API which will be used by other external system in order to download the attachment.

I am confused between Scripted Rest API, Rest Message and Rest API explorer as I am new to this. Please let me know in this case which method will be considered and if you can provide any reference to create a REST API to download the attachment, that would be really helpful for me.

Thank You.

8 REPLIES 8

Yes, 

The Attachment API at attachment API.

Thanks

Hi Ram,

Could you please let me know how any external system be able to access our Attachment API in order to download the attachment?

Thank you.

Hi Ram,

Since processor is deprecated in servicenow and the alternative suggested is scripted rest api, can you suggest what change i should make in above script to work as rest api as i guess g_response will not work in that case?

 

 

How we can use the below packagae in scripted REST API

 var out = new Packages.java.util.zip.ZipOutputStream(g_response.getOutputStream());