Skip to content

Update User Object

User property values of the logged in users can be updated with an API operation described below. This operation is useful if an application needs to provide to the users the functionality for updating user profiles and registration properties. A user must be logged in in order to update his registration properties.

Method

PUT

URL

https://api.backendless.com/<application-id>/<REST-api-key>/users/<user-id>

where:

Argument                Description
<application-id> the ID of your application generated upon its creation. You can obtain the value in the Manage > App Settings section of the Backendless Console.
<REST-api-key> REST API key of your application. You can obtain the value in the Manage > App Settings section of the Backendless Console.
<user-id> a value of the "id" property received in the response for the Login operation.

Request Headers

Content-Type:application/json  
user-token:value-of-the-user-token-header-from-login

where

Argument                Description
Content-Type must be set to application/json. This header is mandatory.
user-token a value returned by Backendless in the response for the preceding Login operation. If user-tokenis set in this request, the currently logged in user will be assigned to the ownerId property of the user object which is being updated. This is done to facilitate the user object retrieval according to "Owner Policy." This header is optional.

Request Body

{  
  "email" : value,  
  "password" : value,  
  ...  
}

Response Body

{  
  "email" : value,  
  "password" : value,  
  ...  
}

Errors

When the server-side reports an error, it returns a JSON object in the following format:

{  
  "message":error-message,  
  "code":error-code  
}

The following errors may occur during the Update User Properties API call.

Error Code
Description
2002
Version is disabled or provided wrong application info (application id or secret key)
3018
The property marked as "identity" is being updated and another user already has the specified value which must be unique.
3024
General "update registration" error. Error message should contain additional details.
3028
User is not logged in.
3029
Cannot modify properties of another user. Returned when one user is logged and the call attempts to modify properties of another user.
3030
Unable to locate user account - invalid user id.
3031
A new "dynamic" property is being added, but dynamic property definition is disabled.
3045
Required properties in the provided object do not contain values.
curl   
  -H user-token:[`value-of-user-token-from-login`](users_login.md#response-body)  
  -H Content-Type:application/json   
  -X PUT   
  -d '{"phoneNumber":"5551212"}'   
  -v   
  https://api.backendless.com/application-id/rest-api-key/users/value-of-id-from-login