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
07-06-2023 01:26 PM
If the issue is reagarding the authorization then we would get a different response code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2023 09:25 AM - edited 05-06-2023 09:26 AM
In my case I was seeing the exact same behavior when I sent "sys_id" with a null value in the request (easy to do if you, like me, are using a library to convert an object into JSON which is described by a class - depending on library options, it may consider "null" in the "sys_id" field to be signficant and worth including in the JSON document). If I just don't include the "sys_id" in the JSON document that is sent at all, it does include the created record in the response.
Payload sent that didn't work:
{"short_description": "test", "description": "test", "sys_id": null}
Payload sent that did work:
{"short_description": "test", "description": "test"}
