- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2016 05:25 AM
Hi Friends,
I want to create a new user in service now by using REST API with the specified user role to the user.
my input is given below,
{"user_name":"maheswar","first_name":"Shiv","last_name":"Maheswar","title":"Administrative Assistant","department":"Development","user_password":"mypassword","active":"true","email":"abc@gmail.com","mobile_phone":"958747845",
"roles":"rest_service,web_service_admin,admin"}
the user is created but no userrole assign to him
is my input assignment is wrong - "roles":"rest_service,web_service_admin,admin" ?
please any help me on this.
Regards,
Thiyagu
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2016 05:48 AM
Hi Thiyagarajan,
User records are present in 'sys_user' table, I assume your rest wsdl is pointing to this table.
A separate table "sys_user_has_role" has the records for roles associated to any user.
While creating the user using REST API you will also have to create record in "sys_user_has_role" table for that user with the desired role. Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2019 05:36 AM
Has anybody find the solution for this.
I am also facing the same issue.
I was able to create the user using the Table API but not able to login with the created user.
Do i need to use any other API to create the user?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2020 02:30 PM
?sysparm_input_display_value=true Add this to your API to encrypt your password.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2017 03:43 PM
I have managed to create user and assign admin role to him fom REST API Explorer. But when I try to get some data from a map from REST API I get unauthorized.
Anyone that knows what my problem may be?
Regards,
Mihaela
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-20-2019 12:50 AM
In my developer instance, I am able to create a user with this api /api/now/v2/table/sys_user. But i couldnt login to the servicenow portal using this user. Any idea why this is happening?