- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2016 02:07 AM
Hello,
I need help please
How I can create new user in service now using rest API and assing him a role?
If possible an example will be helpful
Thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2016 02:46 AM
Hi Alassane,
If you have the endpoint of the post method from this form you can use that and consume the REST service in your java code like any other rest webservice by passing the variables like in any other REST webservice.
Moreover, you can refer this page as well.
Table API Java Examples - ServiceNow Wiki
Hope it helps.
Thanks and Regards,
Vikas Malhotra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2016 02:08 AM
Hi,
Please check how to create new user in service now using rest API and assing admin role to him?
-Vikas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2016 02:17 AM
Hi Viskas,
Thanks for your answer
I saw this link. I need more detail.How I can use the table "sys_user " to create and the table "sys_user_has_role" to assing him a role?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2016 02:27 AM
Hi Alassane,
Please go to REST API Explorer. There you will find a form like this:
Here you can select the name of table like "sys_user" in thsi case and post method to insert a record (on the left side in blue). Then below you will find the request body tab here you can add the fields and their values.
Something like this:
and then click send.
New user will be created same is with sys_user_has_role.
Hope its helpful.
Thanks and Regards,
Vikas Malhotra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2016 02:40 AM
Hi Vikas,
I want to create user and assing him a role using REST API in java from Eclipse. After doing that you explain me above. How I can use it in my java code?
Thank you for your answer