How to create and update ticket using REST API?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2014 03:52 AM
Hi All,
i'm trying to create a ticket and update the ticket using REST API.
i'm able to create a ticket in incident table using HttpPost class.
when i try to update the ticket using HttpPut class.
it throws an error saying that "PUT Method not supported for API".
How to update the ticket in incident table?
Please help me.
Thanks in advance,
Regards,
Rajesh
@
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2015 10:35 AM
Not sure if this is resolved and also cannot comment on Httpput class usage but just want to let you know, to support clients who don't have support to all http actions, servicenow API let you to override actual http method with a header.
you can set header "X-http-method-override"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2016 02:17 AM
Hi Rajesh,
Maybe this is not the cause of your issue but
does the PUT specify the sys_id? along the lines of:
https://myinstance.service-now.com/api/now/table/incident/7b7eec8347a2210016dcd8966c9a71fd
Best Regards
Tony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2017 12:05 AM
Can we change the url to have number instead of sys_id?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2021 08:17 AM
I know it is 5 years down the line - but this post became useful for me to update a record in a table .
Thanks a lot so the Service now PUT will not work If we dont mention the sys_id of the record we are trying to update in the URL . thanks a lot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2017 10:11 AM
Hi,
I was facing the same issue, but I am able to resolve it now.
Only thing which I was doing wrong was, I was not adding the sys_id of the row which is to be updated in the http connection URL.
URL format: https://{instance_url}/api/now/table/{table_name}/{sys_id}
Note: While using PUT or DELETE request, above URL format solves the issue.