Planfix API contact.getList: Difference between revisions
From Planfix
								
												
				No edit summary  | 
				 (→Go To)  | 
				||
| Line 246: | Line 246: | ||
== Go To ==  | == Go To ==  | ||
*[[Planfix API:Contacts]]  | *[[Planfix API:Contacts]]  | ||
*[[Error codes]]  | *[[Error codes XML API v1|Error codes]]  | ||
*[[List of functions]]  | *[[List of functions]]  | ||
Latest revision as of 09:15, 6 March 2024
Function for getting a list of contacts. Request format:
<?xml version="1.0" encoding="UTF-8"?>
<request method="contact.getList">
  <account></account>
  <sid></sid>
  <pageCurrent></pageCurrent>
  <pageSize></pageSize>
  <target></target>
  <company></company>
  <search></search>
  <filters>
    <filter>
      <type></type>
      <operator></operator>
      <value></value>
      <field></field>
      ...
    </filter>
    ...
  </filters>
  <fields>
    <field>lastUpdateDate</field>
    ...
  </fields>
  <signature></signature>
</request>| Name | Type | Value | Note | 
|---|---|---|---|
| pageCurrent | int | requested page | |
| pageSize | int | requested list size | |
| target | enum / int | contacts, companies or a specified task filter | see acceptable values below | 
| company | int | company identifier, contacts that need to be selected | optional, if the node is absent - the selection is not limited to one company | 
| search | string | string for contact search, contacts containing this string in their name, surname, or email will be returned | |
| filters | additional complex filters | see the list and format of acceptable values in the section contact filters | |
| fields | get additional fields | ||
| fields.field | string | field, possible values:
  | 
a field with the same name will be added to the response in the contact node | 
| signature | string(32) | signature | 
Acceptable values for the target parameter
| Value | Description | Note | 
|---|---|---|
| contact | contacts | default value | 
| company | companies | |
| template | templates | |
| contact filter identifier | available filters can be obtained with the function contact.getFilterList | 
Result of successful request execution:
<?xml version="1.0" encoding="UTF-8"?>
<response status="ok">
  <contacts count="count" totalCount="totalCount">
    <contact>
      <id></id>
      <userid></userid>
      <general></general>
      <template>
        <id></id>
      </template>
      <name></name>
      <lastName></lastName>
      <isCompany></isCompany>
      <post></post>
      <email></email>
      <phones>
          <phone>
              <number></number>
              <typeId><typeId>
              <typeName><typeName>
          </phone>
          ...
      </phones>
      <address></address>
      <description></description>
      <sex></sex>
      <skype></skype>
      <facebook></facebook>
      <telegramId></telegramId>
      <icq></icq>
      <userPic></userPic>
      <birthdate></birthdate>
      <havePlanfixAccess>{true|false}</havePlanfixAccess>
      <user>
        <login></login>
        <role></role>
        <status></status>
        <email></email>
      </user>
      <contractors>
        <client>
          <id></id>
          <name></name>
        </client>
        <client>
          <id></id>
          <name></name>
        </client>
        <!-- ... -->
      </contractors>
      <customData>
        <customValue>
          <field>
            <id></id>
            <name></name>
          </field>
          <value></value>
          <text></text>
        </customValue>
        <customValue>
          <!-- ... -->
        </customValue>
        <!-- ... -->
      </customData>
    </contact>
    <!-- ... -->
  </contacts>
</response>| Name | Type | Value | Note | 
|---|---|---|---|
| contacts | contact list | ||
| contacts count | int | number of contacts in the list | |
| contacts totalCount | int | umber of contacts satisfying the request condition | |
| contact | node describing the contact | ||
| id | int | contact identifier | |
| userid | int | contact identifier for cases when it is used in the system on par with employees (task assignee and so on, as well as user field of contact type) | |
| general | int | contact number | |
| template.id | int | contact template number | |
| name | string | First name Middle name | |
| lastName | string | Surname | |
| isCompany | boolean | Is a company | |
| post | string | Position | |
| string | email address | ||
| phones | phone list | ||
| phones.phone.number | string | phone number | |
| phones.phone.typeId | int | phone number type identifier | |
| phones.phone.typeName | string | phone number type name | |
| address | string | Address | |
| description | string | Additional information | |
| sex | enum | gender | see acceptable values in the section customer's gender | 
| skype | string | skype | |
| string | |||
| telegramId | string | telegramId | |
| icq | string | icq number | |
| userPic | string | link to the image | |
| birthdate | DateTime | birthdate | |
| signature | string(32) | signiture | |
| contractors | counterparty list to which it relates | ||
| contractors.client | counterparty description | ||
| contractors.client.id | int | customer/counterparty identifier | |
| contractors.client.name | string | counterparty name/title | |
| havePlanfixAccess | bool | does the contact have access to Planfix | this parameter is returned only to a user with administrator rights | 
| user | contact credentials | this parameter is returned only to a user with administrator rights | |
| user.login | string | login in the system | |
| user.role | string | role | |
| user.status | enum | status | |
| user.email | string | email address | |
| customData | custom task fields values | ||
| customData.customValue.field.id | custom field identifier | ||
| customData.customValue.field.name | custom field name | ||
| customData.customValue.value | custom field value | ||
| customData.customValue.text | text value of the custom field | 
Otherwise, a response with an error will be returned:
<?xml version="1.0" encoding="UTF-8"?>
<response status="error">
  <code></code>
</response>