Update User
Table of Contents
Overview
The zoho.directory.updateUser task is used to update the details of a user with new values in an organization.
Syntax
<response> = zoho.directory.updateUser(<orgID>, <userID>, <userData>, <connection>);
Scope
ZohoDirectory.Users.UPDATE
where:
Parameter | Description | Data type |
response | is the variable that will hold the details of the user whose details needs to be updated. | KEY-VALUE |
<orgID> | is the ID of the organization in which the user details needs to be updated. | NUMBER |
<userID> | is the ID of the user whose details needs to be updated. | NUMBER |
<userData> | is the variable that will hold the user data. The supported user data that can be included are
| KEY-VALUE |
<connection> | is the name of the Zoho Directory connection. | TEXT |
Example
The following script updates a user with ID - 1510XXXXXXXX with user data like gender, email ID, designation ID, and language in Zoho Directory organization with ID - 72XXXXXXX:
userData = Map(); userData.put("gender", "M"); userData.put("designation_id", "48XXXXXX"); userData.put("language_code", "en"); response = zoho.directory.updateUser(72XXXXXXX, 1510XXXXXXX ,userData, "zoho_directory_connection")
where:
response
This is the KEY-VALUEresponse returned by Zoho Directory.
72XXXXXXX
This is the NUMBERthat represents the organization ID of Zoho Directory account.
zoho_directory_connection
This is the TEXTthat represents the link name of the connection.
1510XXXXXXX
This is the NUMBERthat represents the user ID whose details needs to be updated.
M
This is the This is the GENDERof the user to be updated.
48XXXXXX
This is the This is the DESIGNATION ID of the user to be updated.
en
is the This is the LANGUAGE CODE of the user to be updated.
Response format
{
"status_code": 200,
"resource_name": "users",
"message": "Profile has been updated successfully.",
"users": {
"address": [
{
"street_address": "Test",
"country": "in",
"extension": "1234",
"address_type": 1,
"phone": "98********",",
"city": "Test",
"seating_location": "Floor 1 - 2B",
"mobile": "98********",
"state": "test",
"postal_code": "test"
}
],
"gender": "F",
"department_id": "63******",
"timezone": "Asia/Kolkata",
"customFields": [
{
"field_id": "141********",
"field_value": "A"
}
],
"date_of_birth": 1362096000000,
"designation_id": "72******",
"last_name": "User1",
"reporting_to": "1494***********",
"work_location": "location1",
"zuid": "84185086",
"language_code": "en",
"employee_id": "1234444",
"date_of_joining": 1709251200000,
"href": "https://directory.zoho.com/api/v1/orgs/72*******/users/1510*********",
"first_name": "confirmed1"
}
}
"status_code": 200,
"resource_name": "users",
"message": "Profile has been updated successfully.",
"users": {
"address": [
{
"street_address": "Test",
"country": "in",
"extension": "1234",
"address_type": 1,
"phone": "98********",",
"city": "Test",
"seating_location": "Floor 1 - 2B",
"mobile": "98********",
"state": "test",
"postal_code": "test"
}
],
"gender": "F",
"department_id": "63******",
"timezone": "Asia/Kolkata",
"customFields": [
{
"field_id": "141********",
"field_value": "A"
}
],
"date_of_birth": 1362096000000,
"designation_id": "72******",
"last_name": "User1",
"reporting_to": "1494***********",
"work_location": "location1",
"zuid": "84185086",
"language_code": "en",
"employee_id": "1234444",
"date_of_joining": 1709251200000,
"href": "https://directory.zoho.com/api/v1/orgs/72*******/users/1510*********",
"first_name": "confirmed1"
}
}