GET/{resource-id}

Returns the list of objects for the specified resource.

Request format

GET https://jsonapi.partner2.yandex.com/vX
  ? [fields[{resource-id}]=<string>]
  & [page[size]=<integer>]
  & [page[number]=<integer>]
  & [filter=<string>]
  & [include=<string>]

Parametr

Description

resource-id

ID of the resource to get information for.

fields[{resource-id}]

Parameters that are available for objects. Acceptable values:

  • actions — Actions allowed for the current object.

  • block_type — Ad unit type.

  • brands — Brands set for this object.

  • client_id — Client ID.

  • dsp_blocks — Size of display ad unit. For interstitial and rewarded units, you can leave this field empty.

  • editable_fields — Parameters of the current object that can be edited.

  • email — The client's email address.

  • excluded_domains — Excluded domains.

  • excluded_phones — Excluded phones.

  • formats_setup_mode — Format settings. Acceptable values:

    • standard — Unit formats are configured automatically using default parameters.

    • manual — Unit formats are configured in the design_templates parameter.

  • geo — Regional targeting set for this object.

  • lang — Interface language.

  • lastname — The client's last name.

  • level — The nesting level.

  • login — The user's username.

  • midname — The user's middle name.

  • multistate — The current status of the object.

  • multistate_name — Text description of the object's status.

  • name — Name of the object.

  • page_id — Site ID.

  • parent_id — ID of the parent object.

  • regularity — Sorting order in the interface.

  • roles — The user's roles.

  • status — The status of the object. Acceptable values:

    • sync — Synchronized.

    • pending — Sending.

  • tech_type — Field for working with units for Turbo and AMP pages. Only applicable for "block_type" : "banner". Acceptable values:

    • turbo — Turbo unit.

    • amp — AMP unit.

Restriction.

The allowed values depend on the resource. They are listed in the available_fields parameter for the GET/resources operation.

To add multiple values to the request, separate them with commas.

page[size]

The number of resource objects to include in the response. Default value: 100. Maximum value: 1000.

page[number]

The page number to begin the output from.

filter

Filter. The allowed filter values are listed in the filters parameter for the GET/{resource-id} operation. For more information about filters, see Creating filters.

Restriction.

Filters aren't available for all resources.

include

ID of the related resource. The response contains additional information about the related resource.

Note

To add multiple resources to the request, separate them with commas.

The general structure of the response is given below. The elements may appear in a different order. The structure may contain internal parameters that are not described in the table.

Response format

JSON

 {
  "included":
  [
    {
      "relationships": {
        "{string}": {
          "links": {
            "related": "{string}",
            "self": "{string}"
          }
        },
        ...
      },
      "id": "{string}",
      "type": "{string}",
      "attributes": {
        "actions": {...},
        "brands": [
          {
            "bid": "{string}",
            "blocked": {boolean}
            
          },
          {
            ...
          }
        ],
        "client_id": {integer},
        "email": "{string}",
        "excluded_domains": ["{string}"],
        "excluded_phones": ["{string}"],
        "geo": [
          {
            "id": "{string}",
            "cpm": {integer}
          },
          {
            ...
          }
        ],
        "lang": "{string}",
        "lastname": "{string}",
        "level": {integer},
        "login": "{string}",
        "midname": "{string}",
        "multistate": {integer},
        "multistate_name": "{string}",
        "name": "{string}",
        "page_id": {integer},
        "parent_id": {integer},
        "regularity": {integer},
        "roles": "{string}",
        "status": "{string}"
      },
      "links": {
        "self": "{string}"
      }
    }
  ],
  "data": [
    {
      "relationships": {
        "{string}": {
          "links": {
            "related": "{string}",
            "self": "{string}"
          }
        },
        ...
      },
      "id": "{string}",
      "type": "{string}",
      "attributes": {
      },
      "links": {
        "self": "{string}"
      }
    }
  ],
  "links": {
    "first": "{string}",
    "next": "{string}",
    "prev": "{string}",
    "self": "{string}",
    "last": "{string}"
  },
  "meta": {
    "found_rows": {integer},
    "count": {integer},
    "fields": [
      "{string}",
      "{string}"
    ],
    "filters": 
    [
      {
        "name": "{string}",
        "values":
        [
          {
            "label": "{string}",
            "id": "{string}"
          },
          {
            ...
          }
        ],
        "label": "{string}",
        "type": "{string}"
      }
    ]
  }
}      

Response parameters

  • included Array of objects of the specified related resource.

    • relationships Related resources and objects.

      • links References to objects related to the current object.

        • related Reference to a list of related objects with parameters.

        • self Reference to a list of related objects.

    • id Object ID.

    • type Resource type.

    • attributes Array of object parameters. The list of parameters depends on the resource type. As an example, some of the parameters are shown below.

      • actions Actions available for this object.

      • brands Brands set for this object.

        • bid The minimum bid required for showing the brand (in rubles).

        • blocked The brand is blocked (true or false).

      • client_id Client ID.

      • editable_fields Parameters of the current object that can be edited.

      • email The client's email address.

      • excluded_domains Excluded domains.

      • excluded_phones Excluded phone numbers.

      • geo Regional targeting set for this object.

        • id The region ID. Use the GET/{resource-id} operation to get the region.

        • cpm The minimum CPM required for showing the brand in the current region (in rubles).

      • lang Interface language.

      • lastname The client's last name.

      • level The nesting level.

      • login The user's username.

      • midname The user's middle name.

      • multistate The current status of the object.

      • multistate_name Text description of the object's status.

      • name Name of the object.

      • page_id Site ID.

      • parent_id ID of the parent object.

      • regularity Sorting order in the interface.

      • roles The user's roles.

      • status The status of the object. Acceptable values:

                   - sync — Synchronized.

                   - pending — Sending.

    • links Links associated with the object.

      • self Reference to the current object.
  • data Array of objects of the specified resource.

    • relationships Related resources and objects.

      • links References to objects related to the current object.

        • related Reference to a list of related objects with parameters.

        • self Reference to a list of related objects.

    • id Object ID.

    • type Resource type.

    • attributes Array of object parameters. The list of parameters depends on the resource type. As an example, some of the parameters are shown below.

      • actions Actions available for this object.

      • brands Brands set for this object.

        • bid The minimum bid required for showing the brand (in rubles).

        • blocked The brand is blocked (true or false).

      • client_id Client ID.

      • editable_fields Parameters of the current object that can be edited.

      • email The client's email address.

      • excluded_domains Excluded domains.

      • excluded_phones Excluded phone numbers.

      • geo Regional targeting set for this object.

        • id The region ID. Use the GET/{resource-id} operation to get the region.

        • cpm The minimum CPM required for showing the brand in the current region (in rubles).

      • lang Interface language.

      • lastname The client's last name.

      • level The nesting level.

      • login The user's username.

      • midname The user's middle name.

      • multistate The current status of the object.

      • multistate_name Text description of the object's status.

      • name Name of the object.

      • page_id Site ID.

      • parent_id ID of the parent object.

      • regularity Sorting order in the interface.

      • roles The user's roles.

      • status The status of the object. Acceptable values:

                   - sync — Synchronized.

                   - pending — Sending.

    • links Links associated with the object.

      • self Reference to the current object.
  • links Links by page.

    • first Link to the first page.

    • next Link to the next page.

    • prev Link to the previous page.

    • self Link to the current page.

    • last Link to the last page.

  • meta This object contains meta information.

    • found_rows The total number of objects.

    • count The number of objects in the response.

    • fields The array of requested parameters.

    • filters Filters that can be applied to objects of the specified resource. For more information about filters, see Creating filters.

      • name Parameter name.

      • values Allowed parameter values. Used for building the filter.

        • label Name of the parameter in the interface.

        • id ID of the filter value.

      • label Name of the parameter in the interface.

      • type Parameter type. Helps identify which operators can be used for building the filter.

Example for JSON

Request:

curl -i -g -H "Accept: application/vnd.api+json" -H "Authorization: token 66..." -X GET "https://jsonapi.partner2.yandex.com/v1/context_on_site_rtb?filter=["multistate","=","deleted"]&fields[context_on_site_rtb]=brands,multistate,multistate_name,actions,editable_fields,geo,status&page[size]=2&page[number]=2"

Response:

HTTP/1.1 200 OK
Server: nginx/1.8.1
Date: Sun, 18 Dec 2016 12:39:50 GMT
Content-Type: application/vnd.api+json
Content-Length: 3607
Connection: keep-alive

{
  "data": [
    {
      "relationships": {
        "context_on_site_campaign": {
          "links": {
            "related": "https://jsonapi.partner2.yandex.com/v1/context_on_site_rtb/R-A-1166-1/context_on_site_campaign",
            "self": "https://jsonapi.partner2.yandex.com/v1/context_on_site_rtb/R-A-1166-1/relationships/context_on_site_campaign"
          }
        },
        "pages": {
          "links": {
            "related": "https://jsonapi.partner2.yandex.com/v1/context_on_site_rtb/R-A-1166-1/pages",
            "self": "https://jsonapi.partner2.yandex.com/v1/context_on_site_rtb/R-A-1166-1/relationships/pages"
          }
        }
      },
      "id": "R-A-1166-1",
      "type": "context_on_site_rtb",
      "attributes": {
        "actions": {},
        "geo": null,
        "status": "sync",
        "multistate_name": "Archived.",
        "multistate": 9,
        "editable_fields": {},
        "brands": "[]"
      },
      "links": {
        "self": "https://jsonapi.partner2.yandex.com/v1/context_on_site_rtb/R-A-1166-1"
      }
    },
    {
      "relationships": {
        "context_on_site_campaign": {
          "links": {
            "related": "https://jsonapi.partner2.yandex.com/v1/context_on_site_rtb/R-A-1304-1/context_on_site_campaign",
            "self": "https://jsonapi.partner2.yandex.com/v1/context_on_site_rtb/R-A-1304-1/relationships/context_on_site_campaign"
          }
        },
        "pages": {
          "links": {
            "related": "https://jsonapi.partner2.yandex.com/v1/context_on_site_rtb/R-A-1304-1/pages",
            "self": "https://jsonapi.partner2.yandex.com/v1/context_on_site_rtb/R-A-1304-1/relationships/pages"
          }
        }
      },
      "id": "R-A-1304-1",
      "type": "context_on_site_rtb",
      "attributes": {
        "actions": {},
        "geo": null,
        "status": "sync",
        "multistate_name": "Archived.\nNo statistics.",
        "multistate": 13,
        "editable_fields": {},
        "brands": "[]"
      },
      "links": {
        "self": "https://jsonapi.partner2.yandex.com/v1/context_on_site_rtb/R-A-1304-1"
      }
    }
  ],
  "links": {
    "first": "https://jsonapi.partner2.yandex.com/v1/context_on_site_rtb?apikey=66..&fields%5Bcontext_on_site_rtb%5D=brands,multistate,multistate_name,actions,editable_fields,geo,status&page%5Bsize%5D=2&filter=%7B%22multistate%22:%22deleted%22%7D&page%5Bnumber%5D=1",
    "next": "https://jsonapi.partner2.yandex.com/v1/context_on_site_rtb?apikey=66..&fields%5Bcontext_on_site_rtb%5D=brands,multistate,multistate_name,actions,editable_fields,geo,status&page%5Bsize%5D=2&filter=%7B%22multistate%22:%22deleted%22%7D&page%5Bnumber%5D=3",
    "prev": "https://jsonapi.partner2.yandex.com/v1/context_on_site_rtb?apikey=6..&fields%5Bcontext_on_site_rtb%5D=brands,multistate,multistate_name,actions,editable_fields,geo,status&page%5Bsize%5D=2&filter=%7B%22multistate%22:%22deleted%22%7D&page%5Bnumber%5D=1",
    "self": "https://jsonapi.partner2.yandex.com/v1/context_on_site_rtb?apikey=66..&fields%5Bcontext_on_site_rtb%5D=brands,multistate,multistate_name,actions,editable_fields,geo,status&page%5Bsize%5D=2&page%5Bnumber%5D=2&filter=%7B%22multistate%22:%22deleted%22%7D",
    "last": "https://jsonapi.partner2.yandex.com/v1/context_on_site_rtb?apikey=66..&fields%5Bcontext_on_site_rtb%5D=brands,multistate,multistate_name,actions,editable_fields,geo,status&page%5Bsize%5D=2&filter=%7B%22multistate%22:%22deleted%22%7D&page%5Bnumber%5D=2798"
  },
  "meta": {
    "found_rows": 5595,
    "count": 2,
    "fields": [
      "actions",
      "brands",
      "editable_fields",
      "geo",
      "multistate",
      "multistate_name",
      "status"
    ],
    "filters": 
    [
      {
        "name": "multistate",
        "values":
        [
          {
            "label": "No statistics",
            "id": "check_statistics"
          },
          {
            "label": "Archived",
            "id": "deleted" 
          },
          {
            "label": "Saving changes",
            "id": "need_update" 
          },
          {
            "label": "Updating",
            "id": "updating" 
          },
          {
            "label": "Working",
            "id": "working" 
          }
        ],
        "label": "Status",
        "type": "multistate"
      }
    ]
  }
}