Skip to content

Getting a list of numbers blocks

Methods get.site_blocks
Description Getting a list of numbers blocks for a website
Who has access Agent, Customer

Parameters of a request

Title Type Required Description
access_token string yes Authentication session key
user_id number no The ID of an agent's customer user who makes request
Is required for agent
To get a list of customer user you need to use the method "get.customer_users"
limit number no Returning entries count. Refer to "Paging"
offset number no Offset that defines from which number to return the entries "limit". Default value is "0". Refer to "Paging"
filter object no Refer to "Filters"
fields array no Refer to "Viewing returning data"
sort array no Refer to "Data sorting"

Parameters of a reply

Title Type Valid values Filtering Sorting Description
id number yes Block unique ID
name string yes Block name
site_id number yes yes Website unique ID
site_domain_name string yes Website address in the internet. Whithout protocol - "http://" or "https://".
Template for a number
templates array Template for numbers in a block
template_id number Unique ID of a template for a virtual number.
template_type enum
  • image
  • text
Template type
  • image;
  • text.
element_attribute enum
  • id
  • class
  • name
  • selector
  • phone_number
Attribute of the substituted website page element
  • id;
  • class;
  • name;
  • selector;
  • phone_number.
element_attribute_value string Title, value of a substitute element on a website page
phone_number_template string If the parameter `template_type` has value "text", the field has value. Template for a displayed number. You can put any text in a template, as well as special tags: {country} - country code, {city} - city code, {phone} - phone number
phone_number_mask string If the parameter `template_type` has value "text", a field has value. The field defines the format of how {phone} is displayed (refer to the parameter `phone_number_template`) For digits use the symbol #. The length of a number can be anywhere between 5 and 7 symbols. If a substitute number is longer/shorter than a specified mask, any excess/missing symbols will be deleted from the beginning/added to the beginning. For example, a mask ##-##-## for number 123456 means that the number is displayed on the website as 12-34-56, the number 1234567 is displayed as 123-45-67, and the number 12345 is displayed as 1-23-45.
Virtual numbers and advertising campaign
phone_numbers array yes If a block is set in an advertising campaign, it can contain a list of virtual numbers connected with the block
phone_number string Virtual phone number
phone_number_id number Virtual number unique ID
campaign_id number Unique ID of an advertising campaign that has a preset block, i.e. the block has a set substitute number.
campaign_name string The name of an advertising campaign that has a preset block, i.e. the block has a set substitute number.
image_url string Image URL if the parameter `template_type` = `image`

JSON request structure

{
  "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 reply structure

{
  "jsonrpc": "2.0",
  "id": "number",
  "result": {
    "meta_data": {

    },
    "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 returning errors

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