How to upload a file as an attachment using REST API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2016 07:10 AM
Found the following example on how to send a request to upload a file, however when I try to send the same request (with appropriate auth credentials and file) I get the following error:
{"error":{"message":"Requested URI does not represent any resource","detail":"Requested URI does not represent any resource Check logs for error trace or enable glide.rest.debug property to verify REST request processing"},"status":"failure"}
with no further info.
Does anyone managed to upload a file with the above requests?
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2016 08:30 AM
Hi Rony,
What method are you using to upload the file. The following is a pretty good method to do that pre-Geneva.
Generate Attachments in ServiceNow via REST-John Andersen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2016 08:21 AM
Thx!
Worked when I used /ecc_queue.do?JSONv2&sysparm_action=insert.
However, the sys_id I get is different from the one that exists in 'sys_attachment' table - any idea on how to get the sys_id in 'sys_attachment' (so I'll be able to edit/delete the record when needed)?