Skip to content

Get scenarios

Getting list of scenarios

Method get.scenarios
Description Getting a list of scenarios
Who has access Agent, Customer

Parameters of a request

Name Type Required Description
access_token string yes Authentication session key
user_id number no Unique user ID of a customer or an agent who makes request
Is required for agent
To access a list of customer users, use the method "get.customer_users"
limit number no Count of returning entries. Refer to Paging
offset number no Offset that defines from which entry number to return the limit of entries. 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 yes Scenario unique ID
name string yes yes Scenario name
virtual_phone_numbers array yes Virtual phone numbers that use the scenario
sites array yes List of websites for which the scenario is selected as the default scenario
campaigns array yes List of advertising campaigns that virtual numbers with active rule to tie with the scenario are bind to

JSON request structure

{
  "jsonrpc":"2.0",
  "id":"number",
  "method":"get.scenarios",
  "params":{
    "access_token":"string",
    "user_id":"number",
    "offset":"number",
    "limit":"number",
    "filter":{

    },
    "sort":[
      {
        "field":"string",
        "order":"string"
      }
    ],
    "fields":[
      "string"
    ]
  }
}

JSON reply structure

{
  "id": "number",
  "jsonrpc": "2.0",
  "result": {
    "data": [
      {
        "id": "number",
        "name": "string",
        "virtual_phone_numbers" :["string"],
        "sites":[
          {
            "site_id": "number",
            "site_domain_name": "string"
          }
        ],
       "campaigns":[
          {
            "site_id": "number",
            "site_domain_name": "string",
            "campaign_id": "number",
            "campaign_name": "string"
          }
        ]
      }
    ],
    "metadata": {
    }
  }
}

List of returning errors

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