How I can create new user in service now using rest API and assing him a role?

dougoutigi
Mega Contributor

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

1 ACCEPTED SOLUTION

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


View solution in original post

11 REPLIES 11

dougoutigi
Mega Contributor

Hi Tony,


I can't access to the curl with admin, admin


dougoutigi
Mega Contributor

Hi Tony,


Like that :


String postData = "{'first_name':'Alassane','user_name':'alassane.sidibe','last_name':'SIDIBE',"


                    + "'title':'dgdhh','department':'ggjjjjj, 9+++++','user_password':'admin',"


                    + "'password_needs_reset':'true','locked_out':'false','active':'true',"


                    + "'internal_integration_user':'true','date_format':'jj/mm/aaaa','"


                    + "email':'agbk@nnnn.com'}" ;