GET/{resource-id}/{object-id}

Returns the specified object.

Request format

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

Parameter

Description

resource-id

ID of the resource to get information for.

object-id

ID of the returned object.

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 — User login.

  • 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 — 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.

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},
            "cpm": {integer}
          },
          {
            ...
          }
        ],
        "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": {
      "actions": {...},
      "brands": [
        {
          "bid": "{string}",
          "blocked": {boolean},
          "cpm": {integer}
        },
        {
          ...
        }
      ],
      "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}"
  },
  "meta": {
    "fields": [
      "{string}",
      "{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 allowed for the current 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 phones.

      • geo Regional targeting set for this object.

        • id 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 User login.

      • midname The user's middle name.

      • multistate The current status of the object.

      • multistate_name Text description of the object's status.

      • name Object name.

      • page_id Site ID.

      • parent_id ID of the parent object.

      • regularity Sorting order in the interface.

      • roles The user's roles.

      • status Object status. 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 allowed for the current 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 phones.

      • geo Regional targeting set for this object.

        • id 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 User login.

      • midname The user's middle name.

      • multistate The current status of the object.

      • multistate_name Text description of the object's status.

      • name Object name.

      • page_id Site ID.

      • parent_id ID of the parent object.

      • regularity Sorting order in the interface.

      • roles The user's roles.

      • status Object status. Acceptable values:

               - **sync** — Synchronized.
        
               - **pending** — Sending.
        
  • links Links associated with the object.

    • self Reference to the current object.
  • meta This object contains meta information.

    • fields The array of requested parameters.

Example for JSON

Request:

curl -i -g -H "Accept: application/vnd.api+json" -H "Authorization: token bf..." -X GET "https://jsonapi.partner2.yandex.com/v1/context_on_site_rtb/R-A-3228-1?fields[context_on_site_rtb]=brands,multistate,multistate_name,actions,editable_fields,geo,status"

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: 1099
Connection: keep-alive{
  "data":{
    "relationships":{
      "context_on_site_campaign":{
        "links":{
          "related": "https://jsonapi.partner2.yandex.com/v1/context_on_site_rtb/R-A-3228-1/context_on_site_campaign",
          "self": "https://jsonapi.partner2.yandex.com/v1/context_on_site_rtb/R-A-3228-1/relationships/context_on_site_campaign"
        }
      },
      "pages":{
        "links":{
          "related": "https://jsonapi.partner2.yandex.com/v1/context_on_site_rtb/R-A-3228-1/pages",
          "self": "https://jsonapi.partner2.yandex.com/v1/context_on_site_rtb/R-A-3228-1/relationships/pages"
        }
      }
    },
    "id": "R-A-3228-1",
    "type": "context_on_site_rtb",
    "attributes":{
      "actions":{
        "duplicate": "Duplicate"
      },
      "geo": null,
      "status": "sync",
      "multistate_name": "Active.",
      "multistate": 2,
      "editable_fields":{
        "geo": true,
        "brands": true
      },
      "brands": "[{"bid":"5414","blocked":true},{"bid":"827490","blocked":true}]"
    }
  },
  "links":{
    "self": "https://jsonapi.partner2.yandex.com/v1/context_on_site_rtb/R-A-3228-1"
  },
  "meta":{
    "fields": [
      "actions",
      "brands",
      "editable_fields",
      "geo",
      "multistate",
      "multistate_name",
      "status"
    ]
  }
}