You can update a user's profile with the updateUserProfile method.
Permission to run the request: Account Owner, Administrator, Organization Administrator.
Parameter | Type | Description |
---|---|---|
credentials (required) | credentials | Read the description of the Credentials object. |
userId (required) | string | ID of the user whose profile you want to update. |
fields (required) | array | Array of objects with the following properties: name, value. |
organizationId (optional) | int | Organization the user will be moved to. |
groups (optional) | string[] | Array of IDs of the groups the user will be added to. |
All mandatory fields in the user profile must be included in the request (excluding the field types 'List' and 'Country'). |
After the request has been completed, the system returns an object with the following properties:
Parameter | Type | Description |
---|---|---|
success | bool | True if the user's profile has been updated. |
Type | Description |
---|---|
Unknown user | The user with the specified ID was not found. |
Permission denied | The user has no permissions to update info of the specified user. |
Wrong Parameters | One of the specified parameters is incorrect. |
Invalid value <field_value>. Field <field_name> must be unique. | An error occurs if the Login and Email 'user_fields' have been changed. They should be unique. |
<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://new.webservice.namespace"> <SOAP-ENV:Body> <UpdateUserProfileRequest> <credentials> <accountUrl>http://myaccount.ispringlearn.com</accountUrl> <email>email@email.com</email> <password>password</password> </credentials> <userId>4</userId> <organizationId>1</organizationId> <fields> <field> <name>first_name</name> <value>John</value> </field> <field> <name>email</name> <value>john@gmail.com</value> </field> <field> <name>last_name</name> <value>Smith</value> </field> <field> <name>phone</name> <value>1233123</value> </field> <field> <name>state</name> <value>Texas</value> </field> <field> <name>country_id</name> <value>1</value> </field> <field> <name>password</name> <value>1234</value> </field> </fields> <groups/> </UpdateUserProfileRequest> </SOAP-ENV:Body> </SOAP-ENV:Envelope> |
<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://new.webservice.namespace"> <SOAP-ENV:Body> <UpdateUserProfileResult> <success>true</success> </UpdateUserProfileResult> </SOAP-ENV:Body> </SOAP-ENV:Envelope> |