Getting person_id by visitor_id

Method get.person_visitors
Description Retrieving all visitors with contact information by person_id
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
To obtain a list of client users, you must use the method "get.customer_users"
person_id number yes Unique person identifier

Response parameters

Name Type Valid values Default response Description
person_id number yes Unique identifier of the Person
visitor_id number yes Unique identifier of the visitor on the site
name string no Visitor's name
phones array no List of visitor numbers.
emails array no Visitor email addresses.
company string no Visitor's company
commentary string no Comment

JSON request structure```json

{ "jsonrpc":"2.0", "id":"number", "method":"get.person_visitors", "params":{ "access_token":"string", "user_id":"number", "person_id": "number" } }

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

        },
        "data": [
            {
              "person_id": "number",
              "visitor_id": "number",
              "name": "string",
              "emails":[
                         "email"
                       ],
              "phones":[
                         "phone"
                       ],
              "company": "string",
              "commentary": "string",
            }
        ]
    }
}

JSON example response```JSON

{ "jsonrpc": "2.0", "id": "rMiS6Y5qt1OYo2m9S3S3z", "result": { "data": [ { "name": "Тест", "emails": [ "test@1.ry", "test@2.ru" ], "phones": [ "213123123213", "43534534543" ], "company": "ООО Ромашка", "person_id": 6145241079, "commentary": "Какойто комментарий", "visitor_id": 6152759362 }, { "name": "346356", "emails": [ "qere4@fsdfsd.ry" ], "phones": [ "213123123213", "74564565465" ], "company": null, "person_id": 6145241079, "commentary": null, "visitor_id": 6152759377 } ] } } ```

List of returned errors

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