function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ross McLeod 3Ross McLeod 3 

Update user Using Rest API

Hi

I've created a Custom Field on the user object and I need to update this using the rest API. I keep getting a 204 No Content Response.

The url I am using is: services/data/v51.0/sobjects/user/myUserId

I am using a Patch Request to run the update.

The body of my update contains just the custom field that I wish to update which is an encrypted text field.

Any help most appreciated.

 
Best Answer chosen by Ross McLeod 3
AbhinavAbhinav (Salesforce Developers) 
Hi Ross,

204 No Content does not mean an error code. 
Please refer below link.
https://salesforce.stackexchange.com/questions/265163/is-it-fine-to-get-204-no-content-in-patch-method

I would suggest please check your user record if its getting updated or not.I think it should be updated as I did similar testing in my dev org and found that user is getting updated.

Hope above information helps, Please mark as Best Answer so that it can help others in the future.

Thanks!

All Answers

AbhinavAbhinav (Salesforce Developers) 
Hi Ross,

204 No Content does not mean an error code. 
Please refer below link.
https://salesforce.stackexchange.com/questions/265163/is-it-fine-to-get-204-no-content-in-patch-method

I would suggest please check your user record if its getting updated or not.I think it should be updated as I did similar testing in my dev org and found that user is getting updated.

Hope above information helps, Please mark as Best Answer so that it can help others in the future.

Thanks!
This was selected as the best answer
Ross McLeod 3Ross McLeod 3
Lovely thank you for that.