Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

set user location using REST API Explorer

dougoutigi
Mega Contributor

Hello,

I want to set user location using REST API Explorer while create user. But it doesn't work.

Can someone help me please?

Thanks

6 REPLIES 6

larstange
Mega Sage

Hi


I just create a user via the REST API Explorer and set the location - it was working fine...


find_real_file.png


Remember that location is a reference field, so you must match a sys_id or a display value of one of your locations


dougoutigi
Mega Contributor

Hi,


Thank you for your answer. I wanted to use the table location(cmn_location)


Hi Alassane,



This worked for me as admin.



Best Regards



Tony


curl "https://xxxxx.service-now.com/api/now/table/cmn_location" \


--request POST \


--header "Accept:application/json"\


--header "Content-Type:application/json" \


--data "{\"name\":\"london\"}" \


--user 'admin':'xxxxx'



Screen Shot 2016-09-05 at 4.31.04 PM.JPG