Skip to content

Scenarios

Method get.scenarios
API version
Description Retrieves a list of scenarios

Available to: Agent, Client

Request parameters

Name Type Required Description
access_token string yes Authentication session key
user_id number no Unique ID of the customer user on whose behalf the request is made. Required for requests made by an agent. To retrieve a list of customer users, use "get.customer_users".
limit number no Maximum number of records to return. See the "Paging" section.
offset number no Number of records to skip before returning results. Default: 0. See the "Paging" section.
filter object no Filtering criteria. See the "Filters" section.
fields array no Fields to include in the response. See the "Viewing returned data" section.
sort array no Sorting criteria. See the "Data sorting" section.

Response parameters

Name Type Valid values Filtering Sorting Returned by default Description
id number yes yes yes Unique scenario ID
name string yes yes yes Scenario name
virtual_phone_numbers array yes yes Virtual phone numbers that use this scenario
sites array yes yes Sites where this scenario is selected as the default
campaigns array yes yes Advertising campaigns associated with virtual phone numbers that have an active linking rule for this scenario
operations array yes Operations included in the scenario
id number Unique scenario operation ID
name string Scenario operation name

Example request

{
    "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"
        ]
    }
}

Example response

{
    "jsonrpc": "2.0",
    "id": "number",
    "result": {
        "metadata": {},
        "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"
                    }
                ],
                "operations": [
                    {
                        "id": "number",
                        "name": "string"
                    }
                ]
            }
        ]
    }
}

List of returned errors

See the "List of errors for get methods" section.