update user profile using REST API

amitservicenow
Kilo Contributor

I want to update a already existing user profile using REST Api. The problem is that PATCH request in servicenow API explorer does not give me a field to write the matching query.

Could someone let me know how can i match the 'user_name' field in user table using api so that the user record can be updated when the user fills the front end form which is written in .Net

7 REPLIES 7

Atul Kumar2
Giga Guru

Hi Amit,



Can you try to match the user by sys_id of the user record if it is not going work with user_name?



Regards,


Atul Kumar


Hi Atul,



I tried using the sys_id as well. But its not working. I need to provide the Patch URL to the front end UI team to update the record.



I used https://eyukdemo2.service-now.com/api/now/table/sys_user/e6a724c34f145200e6bba3628110c7e2



this is not able to update the record


Hi amit,



url looks correct. make sure you can update the User record using REST api explorer of instance. to confirm that   url is correct. also make sure you are passing the right credentials with proper roles.


Hi Rushit,



I can update the record using instance api explorer but the problem here is that the sys_id field of PATCH api explorer is a mandatory field. How to provide that information to the UI team so that they can use the api to update the record?



for every user the sys_id will be different, so what URL should i give the the front end team?