Sending attachments over a REST message to an incident

chandra_ym
Kilo Expert

how do i send an attachment to an incident over a REST message ?

The target instance has a scripted REST API Endpoint, which I need to consume and send an update to an incident including attachment files. 

Also, how do i parse the received REST message on the target, extract the attachment and attach it to the incident?

2 REPLIES 2

Tony Chatfield1
Kilo Patron

Hi, I don’t think you need to parse the attachment message, as there is a dedicated Attachment API.

The response from your incident insert\update should give you the record sys_id and sys_class_name and with these values (and the file name) you should be able to use the Attachment API to upload your file(s).

The SN Nerd
Giga Sage
Giga Sage

If you are sending an attachment from one instance to another, the solution below may help you:

Sending a pdf to the Rest API with javascript

https://community.servicenow.com/community?id=community_question&sys_id=a4f0c7a5db98dbc01dcaf3231f96...


ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022