| Method | get.site_blocks |
|---|---|
| Description | Getting a list of site number blocks |
| Available to | Agent, Client |
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 "get.customer_users" method |
limit |
number | no | Number of records returned. See section "Paging" |
offset |
number | no | Shift determines from which record number to return "limit" records. Default is "0". See section "Paging" |
filter |
object | no | See section "Filtering criteria" |
fields |
array | no | See section "View of returned data" |
sort |
array | no | See section "Sorting data" |
Response parameters
| Name | Type | Valid values | Filtering | Sorting | Description |
|---|---|---|---|---|---|
id |
number | yes | Unique block identifier | ||
name |
string | yes | Block name. | ||
site_id |
number | yes | yes | Unique site identifier | |
site_domain_name |
string | yes | Internet site address. Without specifying the protocol - "http://" or "https://". | ||
| Template for number | |||||
templates |
array | Template of numbers in a block | |||
template_id |
number | Unique identifier of the virtual number template. | |||
template_type |
enum |
|
Template type
|
||
element_attribute |
enum |
|
Attribute of the replaced element on the site page
|
||
element_attribute_value |
string | Name, value of the replaced element on the site page | |||
phone_number_template |
string | If the `template_type` parameter is "text", then the field has a value. Number display template. You can specify any text in the template, as well as special tags: {country} - country code, {city} - city code, {phone} - phone number | |||
phone_number_mask |
string | If the `template_type` parameter is "text", then the field has a value. The field specifies the {phone} display format (see parameter `phone_number_template`) Use the # symbol to indicate numbers. The length of the number can vary from 5 to 7 characters. If the automatically selected number is longer/shorter than the specified mask, all extra/missing characters will be removed from the beginning/added to the beginning. For example, the mask ##-##-## for the number 123456 will indicate that the number on the site is displayed in the format 12-34-56, the number 1234567 will be displayed as 123-45-67, and the number 12345 will be displayed as 1-23-45. | |||
| Virtual numbers and advertising campaigns | |||||
phone_numbers |
array | yes | If a block is configured in an advertising campaign, then it may contain a list of virtual numbers associated with the block | ||
phone_number |
string | Virtual number | |||
phone_number_id |
number | Unique virtual number | |||
campaign_id |
number | A unique identifier of the advertising campaign in which the block is configured, i.e. the block is configured to automatically select a number. | |||
campaign_name |
string | The name of the advertising campaign in which the block is configured, i.e. the block is configured to automatically select a number. | |||
image_url |
string | Image address if parameter `template_type` = `image` | |||
JSON request structure```json
{ "jsonrpc":"2.0", "id":"number", "method":"get.site_blocks", "params":{ "access_token":"string", "user_id":"number", "offset":"number", "limit":"number", "filter":{
},
"sort":[
{
"field":"string",
"order":"string"
}
],
"fields":[
"string"
]
} }
### JSON response structure```json
{
"jsonrpc": "2.0",
"id": "number",
"result": {
"metadata": {
},
"data": [
{
"id": "number",
"site_id": "number",
"site_domain_name": "string",
"templates": [
{
"template_id": "number",
"template_type": "enum",
"element_attribute": "enum",
"element_attribute_value": "string",
"phone_number_template": "string",
"phone_number_mask": "string"
}
],
"phone_numbers": [
{
"phone_number": "string",
"phone_number_id": "number",
"campaign_id": "number",
"campaign_name": "string",
"image_url": "string"
}
]
}
]
}
}
List of returned errors
See the section "List of errors for methods with the verb get"