Retrieving visitor data by their id

Method get.visitors
Description Obtaining visitor data
Available to Agent, Client
Necessary components for working with the method Data API for configuration
Method weight 1 point

Request parameters

Title Type Required Description
access_token string yes Authentication session key
user_id number no Unique user identifier of the agent client on behalf of which the request is made
Is required for the agent
ids array yes List of unique visitor IDs

Response parameters

Name Type Valid values Default response Description
id number yes Unique visitor identifier
name string yes Visitor's name
phones array yes List of visitor numbers
emails array yes Visitor email addresses
usernames array yes Visitor usernames

JSON request structure```json

{ "jsonrpc":"2.0", "id":"number", "method":"get.visitors", "params":{ "access_token":"string", "user_id":"number", "ids": "array" } }

### JSON response structure```JSON
{
    "jsonrpc": "2.0",
    "id": "number",
    "result": {
        "metadata": {

        },
        "data": [
            {
              "id": "number",
              "name": "string",
              "emails":[
                         "email"
                       ],
              "phones":[
                         "phone"
                       ],
              "usernames":[
                         "username"
                       ]
            }
        ]
    }
}

JSON example response```JSON

{ "jsonrpc": "2.0", "id": "number", "result": { "data": [ { "id": 10117621191, "name": "test1", "emails": [ "test1@test1.ru", "test@test.ru" ], "phones": [], "usernames": [ "test1", "test2" ] }, { "id": 10117119711, "name": "test2", "emails": [], "phones": [ "71111111111", "71111111112" ], "usernames": [ "test3" ] } ] } } ```

List of returned errors

See the section "List of errors for methods with the verb get"