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

Hi Alassane,


Maybe the issue is, when the sys_user record is being updated you have to specify the name of a pre-existing location record?


edit:



Ah - I see now that Lars pointed this out earlier   - so   the issue is already resolved by Lars?


this worked for me also, but only because there exists a location record with name = 10719 Alpharetta Highway, Roswell,GA


curl "https://xxxxxx.service-now.com/api/now/table/sys_user" \


--request POST \


--header "Accept:application/json"\


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


--data "{\"user_name\":\"fred4\",\"location\":\"10719 Alpharetta Highway, Roswell,GA\"}" \


--user 'admin':'xxxx'



Best Regards



Tony


Hi,


Thanks for your response. I find the solution I use cmn_location like Tony.