Planfix API user.update: Difference between revisions
From Planfix
(Created page with "A function to update user data. Request format: <source lang="xml"> <?xml version="1.0" encoding="UTF-8"?> <request method="user.update"> <account></account> <sid></sid> <user> <id></id> <name></name> <midName></midName> <lastName></lastName> <email></email> <role></role> <status></status> <password></password> <birthdate></birthdate> <sex></sex> <phones> <phone> <number></number> <typeId><...") |
No edit summary |
||
(4 intermediate revisions by the same user not shown) | |||
Line 45: | Line 45: | ||
|lastName ||string ||user's last name ||optional field | |lastName ||string ||user's last name ||optional field | ||
|- | |- | ||
|email || string|| | |email || string|| email address||optional field | ||
|- | |- | ||
|role ||enum || user's role in the system||optional field. editable only by administrators. full list can be found in the [Planfix API:user roles|user roles]] section | |role ||enum || user's role in the system||optional field. editable only by administrators. full list can be found in the [Planfix API:user roles|user roles]] section | ||
|- | |- | ||
|status ||enum | |status ||enum ||status ||optional field. editable only by administrators. list of acceptable values can be found in the [[Planfix API:user statuses|user statuses]] section | ||
|- | |- | ||
|password ||string ||password ||optional field | |password ||string ||password ||optional field | ||
Line 55: | Line 55: | ||
|birthdate ||DateTime ||birthdate ||optional field | |birthdate ||DateTime ||birthdate ||optional field | ||
|- | |- | ||
|sex ||enum ||employee's gender ||optional field. list of acceptable values can be found in the [[Planfix API: | |sex ||enum ||employee's gender ||optional field. list of acceptable values can be found in the [[Planfix API:Employee gender|employee gender]] section | ||
|- | |- | ||
|phones || string||phones|| | |phones || string||phones|| | ||
Line 86: | Line 86: | ||
</source> | </source> | ||
{| class="wikitable" style="margin-top: 1em; width:100% " | {| class="wikitable" style="margin-top: 1em; width:100% " | ||
!width="150"| | !width="150"|Name !!width="200"| Type !!width="50%"| Value !! Note | ||
|- | |- | ||
|user.id ||int || identifier of the updated user|| | |user.id ||int || identifier of the updated user|| | ||
Line 102: | Line 102: | ||
== Go To == | |||
== | *[[Planfix API:Employees]] | ||
*[[ | *[[Error codes XML API v1|Error codes]] | ||
*[[ | *[[List of functions]] | ||
*[[ |
Latest revision as of 13:51, 22 March 2024
A function to update user data. Request format:
<?xml version="1.0" encoding="UTF-8"?>
<request method="user.update">
<account></account>
<sid></sid>
<user>
<id></id>
<name></name>
<midName></midName>
<lastName></lastName>
<email></email>
<role></role>
<status></status>
<password></password>
<birthdate></birthdate>
<sex></sex>
<phones>
<phone>
<number></number>
<typeId></typeId>
<typeName></typeName>
</phone>
<!-- ... -->
</phones>
<isInvisibleOutOfGroup></isInvisibleOutOfGroup>
<isBlindOutOfGroup></isBlindOutOfGroup>
<userPic></userPic>
<post>
<id></id>
</post>
</user>
<signature></signature>
</request>
Name | Type | Value | Note |
---|---|---|---|
id | int | ||
name | string | user's name | |
midName | string | user's middle name | optional field |
lastName | string | user's last name | optional field |
string | email address | optional field | |
role | enum | user's role in the system | user roles]] section |
status | enum | status | optional field. editable only by administrators. list of acceptable values can be found in the user statuses section |
password | string | password | optional field |
birthdate | DateTime | birthdate | optional field |
sex | enum | employee's gender | optional field. list of acceptable values can be found in the employee gender section |
phones | string | phones | |
phone.number | string | phone number | |
phone.typeId | int | type identifier of the number | acceptable values can be obtained with the contact.getPhoneTypes function |
phone.typeName | string | name of the number type | |
isInvisibleOutOfGroup | bool | true=Sees only members of his groups; false=Sees all employees | optional field. editable only by administrators |
isBlindOutOfGroup | bool | Only members of his groups can see him; false=All employees can see him | optional field. editable only by administrators |
userPic | string | base64 encoded picture | optional field |
post.id | int | position held by the user | optional field |
Result of successful function execution:
<?xml version="1.0" encoding="UTF-8"?>
<response status="ok">
<user>
<id></id>
</user>
</response>
Name | Type | Value | Note |
---|---|---|---|
user.id | int | identifier of the updated user |
Otherwise, a response with an error will be returned:
<?xml version="1.0" encoding="UTF-8"?>
<response status="error">
<code></code>
</response>