Scripted Rest API to create incident and send attachment along with it.

gautham11
Tera Contributor

Please help me to write a scripted API POST to create incident and send attachment along with it. Attachment can be any format (pdf or excel or .docx)

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@gautham11 

if your requirement is to attach file via scripted rest api then check this link where I shared solution and enhance it based on your requirement. enhance the script to create record instead of update

Scripted Rest API to update incident with attachment 

also check this link where I shared solution for something similar

Sending attachments using custom scripted web service 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

3 REPLIES 3

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @gautham11 

 

https://www.servicenow.com/community/developer-forum/scripted-rest-api-call-sending-attachment-along...

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Ankur Bawiskar
Tera Patron
Tera Patron

@gautham11 

if your requirement is to attach file via scripted rest api then check this link where I shared solution and enhance it based on your requirement. enhance the script to create record instead of update

Scripted Rest API to update incident with attachment 

also check this link where I shared solution for something similar

Sending attachments using custom scripted web service 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

@gautham11 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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