Planfix API user.add: Difference between revisions

From Planfix
Jump to: navigation, search
No edit summary
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]]

Revision as of 09:27, 6 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
email 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>


Go To