Receiving visitor data
| Method | getobj.visitor |
|---|---|
| Description | Retrieving 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 agentTo obtain a list of client users, you must use the method "get.customer_users" |
id |
number | yes | Unique identifier of the visitor on the site |
Response parameters
| Name | Type | Valid values | Default response | Description | |
|---|---|---|---|---|---|
name |
string | Visitor name | |||
phone_numbers |
array | List of contact numbers | |||
emails |
array | List of email addresses | |||
| Visitor properties | |||||
properties |
array | Visitor properties | |||
id |
number | Property ID | |||
name |
string | Property name | |||
value |
string | Value | |||
JSON request structure```json
{ "jsonrpc":"2.0", "id":"number", "method":"getobj.visitor", "params":{ "access_token":"string", "user_id":"number", "id": "number" } }
### JSON response structure```JSON
{
"jsonrpc": "2.0",
"id": "number",
"result": {
"metadata": {
},
"data": {
"name":"number",
"phone_numbers": [
"string"
],
"emails":[
"string"
],
"properties":[
{
"id":"number",
"name":"string",
"value": "string"
}
]
}
}
}
JSON example response```JSON
{ "jsonrpc": "2.0", "id": "rMiS6Y5qt1OYo2m9S3S3z", "result": { "data": { "name":"Имя", "phone_numbers": [ "7900000000", "7900000001" ], "emails":[ "email1@mail.ru" ], "properties":[ { "id":1, "name":"Логин", "value": "login" } ] } } } ```
List of returned errors
Look at the section "List of errors for methods with the verb getobj"