Skip to content

Retrieves a list of contacts from the address book

Retrieves a list of contacts from the address book

Method get.contacts
Description Retrieves a list of contacts from the address book
Who has access Agents and clients

Request parameters

Name Type Required Description
access_token string yes Session key used to authenticate the request
user_id number no Unique ID of the client user on whose behalf the request is made. Required when an agent makes the request. To retrieve a list of client users, call "get.customer_users".
limit number no Maximum number of records to return. See the "Paging" section.
offset number no Number of records to skip before returning results. Default: 0. See the "Paging" section.
filter object no Filtering criteria. See the "Filters" section.
fields array no Fields to include in the response. See the "Viewing returned data" section.
sort array no Sorting criteria. See the "Data sorting" section.

Response parameters

Name Type Valid values Filtering Sorting Description
id number yes Unique contact ID
first_name string yes yes Contact's first name
last_name string yes yes Contact's last name
patronymic string Contact's middle name or patronymic
full_name string yes yes Contact's full name (last name, first name, and patronymic)
emails array Up to 10 email addresses yes Email addresses associated with the contact
phone_numbers array Up to 10 phone numbers yes Phone numbers associated with the contact
Personal manager
personal_manager_id number yes Unique ID of the contact's personal manager
personal_manager_full_name string yes Full name of the contact's personal manager
Organization
organization_id number yes Unique ID of the contact's organization
organization_name string yes Name of the contact's organization
Contact groups
groups array yes Groups the contact belongs to
group_id number Unique contact group ID
group_name string Contact group name

Example request

{
  "jsonrpc":"2.0",
  "id":"number",
  "method":"get.contacts",
  "params":{
    "access_token":"string",
    "user_id":"number",
    "offset":"number",
    "limit":"number",
    "filter":{
    },
    "sort":[
      {
        "field":"string",
        "order":"string"
      }
    ],
    "fields":[
      "string"
    ]
  }
}

Example response

{
  "jsonrpc":"2.0",
  "id":"number",
  "result":{
    "metadata":{
    },
    "data":[
      {
        "id":"number",
        "last_name":"string",
        "first_name":"string",
        "patronymic":"string",
        "full_name":"string",
        "emails":[
          "email"
        ],
        "groups":[
          {
            "group_id":"number",
            "group_name":"string"
          }
        ],
        "phone_numbers":[
          "number"
        ],
        "personal_manager_id":"number",
        "personal_manager_full_name":"string",
        "organization_name":"string",
        "organization_id":"number"
      }
    ]
  }
}

List of returned errors

See the "List of errors for get methods" section.