Planfix API user.add

From Planfix
Jump to: navigation, search

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