How to attach file in incident via API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2021 10:48 PM
Hi All,
I have come up with query like. Thirty party is trying to use servicenow table API to query the records . And they are doing some delete action. When they tries to delete a record somehow its not deleted. They are getting error. So in such cases they wanted to create incident and attach those records in xls sheet and attach it in the respective incident via API.Is it possible to attach a "attachment file" via api to servicenow form third party? Can anyone come across such scenario?
- Labels:
-
Script Debugger
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2021 11:05 PM
@Rani
you can use OOB Attachment API
But remember 3rd party will have to know the incident record sys_id so they will have to consume API 2 times
1) get the incident sys_id using Incident Table API
2) then use the Attachment API
ServiceNow REST Attachment API Example Python Example
Another alternative is to create Scripted REST API and they can send the details
Refer below link where I have shared the solution
Scripted Rest API to update incident with attachment
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader