API Post (Create) Not Returning a response in body
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2018 11:48 AM
I am attempting to use the SN Rest API to create users. Every time I do a POST (create) with the user account I created I get a response of 201 which is good since it does create the user (sys_user), but the body of the response is blank...
If I use my local account (which has admin role) and do the same thing I do get a body response with fields from that new record. It appears I have some sort of permission issue.
The weird thing is I can do a get or any other type of API query with that account and all of the field values are returned fine. It's something about doing the Create which is returning a blank response. But the record is created so I'm fairly confused.
I don't want to give this new account an "admin" role. I only want it to be able to create/edit/read the user, department, and location tables. So far I've given it these roles with no success on getting a body response:
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2018 12:36 PM
Strange! I tried with "user_admin" and "web_service_admin" roles (only) and I am able to get a response.
Can you share the Request URL and payload?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2018 01:44 PM
Sure
Request:
https://xxxxxx.service-now.com/api/now/table/sys_user
with body:
{"first_name":"Jordy", "last_name":"Nelson", "user_name":"jnelson"}
response:
{}
Not sure if that's what you are looking for....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-28-2018 01:45 PM
I've tried it with Postman, C#, and the REST api explorer. They all do the same thing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2018 07:11 AM
Not sure where the problem lies. You might want to check the ACLs on User table.
Also, these posts might help:
https://community.servicenow.com/community?id=community_question&sys_id=45d54b21db1cdbc01dcaf3231f961953
https://community.servicenow.com/community?id=community_question&sys_id=c38d472ddb9cdbc01dcaf3231f9619ff
