how to send an attachment from servicenow to third party application using multiform curl.

Naga19
Tera Contributor

Hi, 

I am trying to sending an attachment from ServiceNow to third-party application when we create an incident. 

I received the request body and api as well, but how could i configure in http method in rest message, could you please help me and please let me know if you required any information

Sample request: 

curl -v -u user@company.com:test -F 'attachments[]=@/Users/user/Desktop/api2.png' -F 'priority=3' -X PUT 'https://domain.com/api/v2/tickets/32'

 

Thanks 

Naga

 

 

5 REPLIES 5

Community Alums
Not applicable

Hi Naga,

Refer to this links : https://community.servicenow.com/community?id=community_question&sys_id=ecde0f61dbdcdbc01dcaf3231f96...

Also, 

Check this HI article

https://hi.service-now.com/kb_view.do?sysparm_article=KB0745010

or 

IF wanna try via Attachment API then check this

https://docs.servicenow.com/integrate/inbound_rest/reference/r_SamplePOSTMultipart.html

Mark my answer correct & Helpful, if Applicable.

Thanks,

Sandeep

Hi Sandeep, 

I could see that multi form will support with integration hub, is there any other solution?

 

Thanks

Naga

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

the sample request you are sharing is from curl and will be used when somebody consumes API of ServiceNow from CURL

you need to use REST Message or SOAP Message depending on whether your 3rd party supports SOAP or REST

What did you start and where are you stuck?

There are numerous examples on community and other blogs with sample scripts.

Regards
Ankur

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

Hi Ankur, 

Third-party will supports rest message and so we are using rest message. I have created the HTTP Method in the rest message for put to update ticket with an attachment but i unable to pass the HTTP query parameters in the content filed, could you please help me.

 

Thanks 

Naga