Planfix API user.add: Difference between revisions
From Planfix
(Created page with "This function is used to add a new user. This function can only be executed by a user with admin rights. Request format: <source lang="xml"> <?xml version="1.0" encoding="UTF-8"?> <request method="user.add"> <account></account> <sid></sid> <user> <name>Имя</name> <midName>Отчество</midName> <lastName>Фамилия</lastName> <email></email> <role></role> <status></status> <post> <id></id> </post> <phones>...") |
No edit summary |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 6: | Line 6: | ||
<sid></sid> | <sid></sid> | ||
<user> | <user> | ||
<name> | <name></name> | ||
<midName> | <midName></midName> | ||
<lastName> | <lastName></lastName> | ||
<email></email> | <email></email> | ||
<role></role> | <role></role> | ||
Line 38: | Line 38: | ||
| email||string || user's email|| | | email||string || user's email|| | ||
|- | |- | ||
|role ||enum ||user's role in the system || acceptable values ''ADMIN'', '''USER'''. Full list can be found in the [[ | |role ||enum ||user's role in the system || acceptable values ''ADMIN'', '''USER'''. Full list can be found in the [[Planfix_API:_User_roles|user roles]] section | ||
|- | |- | ||
|post.id || int || position identifier || optional field | |post.id || int || position identifier || optional field | ||
Line 83: | Line 83: | ||
== Go To == | == Go To == | ||
*[[Planfix API:Employees]] | *[[Planfix API:Employees]] | ||
*[[Error codes]] | *[[Error codes XML API v1|Error codes]] | ||
*[[List of functions]] | *[[List of functions]] |
Latest revision as of 14:22, 14 March 2024
This function is used to add a new user. This function can only be executed by a user with admin rights. Request format:
<?xml version="1.0" encoding="UTF-8"?>
<request method="user.add">
<account></account>
<sid></sid>
<user>
<name></name>
<midName></midName>
<lastName></lastName>
<email></email>
<role></role>
<status></status>
<post>
<id></id>
</post>
<phones>
<phone>
<number></number>
<typeId></typeId>
<typeName></typeName>
</phone>
<!-- ... -->
</phones>
</user>
<signature></signature>
</request>
Name | Type | Value | Note |
---|---|---|---|
name | string | user's name | |
midName | string | user's middle name | |
lastName | string | user's last name | |
string | user's email | ||
role | enum | user's role in the system | acceptable values ADMIN, USER. Full list can be found in the user roles section |
post.id | int | position identifier | optional field |
status | enum | user's status | list of acceptable values can be found in the user statuses section |
phones | string | phones | |
phone.number | string | phone number | |
phone.typeId | int | phone number type identifier | acceptable values can be obtained using the contact.getPhoneTypes function |
phone.typeName | string | phone number type name | |
signature | string(32) | signature |
Response:
<?xml version="1.0" encoding="UTF-8"?>
<response status="ok">
<user>
<id></id>
</user>
</response>
Name | Type | Value | Note |
---|---|---|---|
id | int | identifier of the created user |
Otherwise, an error response will be returned:
<?xml version="1.0" encoding="UTF-8"?>
<response status="error">
<code></code>
</response>