Skip to content

Get contacts

Getting contact list in address book

Method get.contacts
Description Getting contact list in address book
Who has access Agent, Customer

Parameters of the request

Title Type Required Description
access_token string yes Authentication session key
user_id number no Unique user ID of a customer or an agent who makes request.
Is mandatory for the agent
To access a list of customer users you need to use the method "get.customer_users"
limit number no Number of returning inquiries. Refer to "Paging"
offset number no Offset that defines from which phone number to return "limit" of recordings. Default value is "0". Refer to "Paging"
filter object no Refer to "Filtering criteria"
fields array no Refer to "View returning errors"
sort array no Refer to "Sorting"

Parameters of a reply

Title Type Valid value Filtering Sorting Description
id number yes Unique ID of a contact
first_name string yes yes Contact first name
last_name string yes yes Contact last name
patronymic string Contact patronymic name
full_name string yes yes Contact full name
emails array Maximum 10 addresses yes Contact's email.
phone_numbers array Maximum 10 addresses yes List of contact's numbers
Personal manager
personal_manager_id number yes Unique ID of a personal account manager
personal_manager_full_name string yes Full name of a personal account manager
Organization
organization_id number yes Unique ID of an organization
organization_name string yes Organization name
Groups a contact belongs to
groups array yes List of groups a contact belongs to
group_id number Unique ID of a group
group_name string Name of a group

JSON request structure

{
  "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"
    ]
  }
}

JSON reply structure

{
  "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 returning errors

Refer to "List of errors common for methods with the verb get"