- 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
‎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
‎04-12-2016 05:52 AM
Hi
yes, add user rest wsdl is pointing to this table sys_user.
Can you give me the add role to that user API code sample for sys_user_has_role?
Regards,
Thiyagu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2016 05:55 AM
post your current API script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2016 01:03 PM
Hi Friends,
Thanks for your suggestions,
Now im able to create user and roles for the user successfully
but i could not login with the newly created user in service now web portal
if logged-in as admin and edit the newly created user and click update without change anything.
now able to login using that user.
can you help on this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2016 01:55 AM
Hello Thiyagarajan,
I want to create User and assigne him a role using REST API, can you help me please?
Thanks