- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2017 03:23 AM
Hi Guys,
I am trying to update the cost center, location of a user in ServiceNow(Geneva) using REST api. I am using
https://devxxxxx.service-now.com/api/now/v1/import/(table) with POST type.
My input is
{
"cost_center":" ",
"user_sys_id":"<user-id>"
}
This gives me "No field values changed" message. When I change the type to patch with the following url
https://devxxxxx.service-now.com/api/now/v1/import/(table)/<user-id>
I get "Method not Supported" message.I even tried with X-http-method-override but it wasn't helpful. I went through this doc but was not able to understand what I was doing wrong. Please advice.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2017 06:14 AM
Hi Kshitiah,
As you are on Geneva and using an import set table this is the documentation URL that refers:
The import set table needs to be specified
Only POST and GET are supported methods - PUT and PATCH are not possible.
However a POST to import set table imp_user will update an existing user record based on user_id.
Any questions arising add them to this thread 🙂
If the reply was informational, please like, mark as helpful or mark as correct!
Also there is a sample CURL request mentioned:
curl "https://instance.service-now.com/api/now/import/imp_user" \
--request POST \
--header "Accept:application/json"\
--header "Content-Type:application/json" \
--data "{'first_name':'John','last_name':'Public','user_id':'john.public','email':'john.public@company.com'}" \
--user 'admin':'admin'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2017 04:10 AM
Hi Kshitish,
Following links should be helpful to you:
Updating record requires sys_id but I think you are not sending that in your URL
http://wiki.servicenow.com/index.php?title=Getting_Started_with_REST#gsc.tab=0
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2017 04:21 AM
Thanks bawiskar for the reply. I am using <user-id> in the url but it has not solved the problem.I had checked the link that you have given but the problem remains.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2017 04:37 AM
Hi Kshitish,
So what value you are sending in the <user-id> in the URL? Is it the sys_id of the record you want to update.
also are you giving correct tablename in the URL
I was able to update incident record using PATCH method using following URL
https://dev17945.service-now.com/api/now/table/incident/2db06b194f4e1a00fc11fa218110c7da
and following request body
{"description":"test","short_description":"test1"}
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2017 05:17 AM