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

Returns the specified object.

Request format

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

Parametr

Description

resource-id

ID of the resource to get information for.

object-id

The ID of the returned object.

fields[{resource-id}]

The parameters available for objects. Acceptable values:

  • actions: The actions allowed for the current object.

  • brands: The brands that were set for the current object.

  • client_id: The ID of the client.

  • editable_fields: The parameters of the current object that can be edited.

  • email: The email address of the client.

  • excluded_domains: The excluded domains.

  • excluded_phones: The excluded phone numbers.

  • geo: The regional targetings set for the current object.

  • lang: The language of the interface.

  • lastname: The last name of the client.

  • level: The level of nesting.

  • login: The login of the user.

  • midname: The middle name of the user.

  • multistate: The current status of the object.

  • multistate_name: The text description of the object status.

  • name: The name of the object.

  • page_id: The ID of the ad platform.

  • parent_id: The ID of the parent object.

  • regularity: The sorting order used in the interface.

  • roles: The roles of the user.

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

    1. sync: Synchronized.

    2. pending: In the process of being sent.

Restriction.

The acceptable values depend on the resource and are listed in the available_fields parameter of the GET/resources operation.

To use multiple acceptable values in your request, list the values, separating them with commas.

include

The ID of the linked resource. The response will contain additional information about the linked resource.

Note

To include multiple linked resources in the request, list their IDs, separating 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 An array of objects of the specified linked resource.

    • relationships The linked resources and objects.

      • links URLs of objects linked to the current object.

        • related The URL of a list of linked objects with parameters.

        • self The URL of a list of linked objects.

    • id The object ID.

    • type The resource type.

    • attributes An array of object parameters. The list of parameters depends on the resource type. Some of the parameters are listed below as an example.

      • actions Acceptable actions for the current object.

      • brands Brands that were set for the current object.

        • bid The minimum bid (in rubles) required for a brand impression.

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

        • cpm The minimum CPM (in rubles) required for a brand impression.

      • client_id Client ID.

      • editable_fields The parameters of the current object that can be edited.

      • email The client's email address.

      • excluded_domains The excluded domains.

      • excluded_phones The excluded phone numbers.

      • geo The regional targetings set for the current object.

        • id ID of the region. To get the region, use the GET/{resource-id} operation.

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

      • lang The language of the interface.

      • lastname The client's last name.

      • level The level of nesting.

      • login Username.

      • midname The user's middle name.

      • multistate The current status of the object.

      • multistate_name Text description of the object status.

      • name The name of the object.

      • page_id The ad platform ID.

      • parent_id The ID of the parent object.

      • regularity The sorting order used in the interface.

      • roles The user's roles.

      • status The status of the object. Acceptable values:

                   - sync: Synchronized.

                   - pending: In the process of being sent.

    • links URLs linked to the object.

      • self The URL of the current object.
  • data An array with information about the specified object.

    • relationships The linked resources and objects.

      • links URLs of objects linked to the current object.

        • related The URL of a list of linked objects with parameters.

        • self The URL of a list of linked objects.

    • id The object ID.

    • type Type of object.

    • attributes An array of object parameters. The list of parameters depends on the resource type. Some of the parameters are listed below as an example.

      • actions Acceptable actions for the current object.

      • brands Brands that were set for the current object.

        • bid The minimum bid (in rubles) required for a brand impression.

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

        • cpm The minimum CPM (in rubles) required for a brand impression.

      • client_id Client ID.

      • editable_fields The parameters of the current object that can be edited.

      • email The client's email address.

      • excluded_domains The excluded domains.

      • excluded_phones The excluded phone numbers.

      • geo The regional targetings set for the current object.

        • id ID of the region. To get the region, use the GET/{resource-id} operation.

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

      • lang The language of the interface.

      • lastname The client's last name.

      • level The level of nesting.

      • login Username.

      • midname The user's middle name.

      • multistate The current status of the object.

      • multistate_name Text description of the object status.

      • name The name of the object.

      • page_id The ad platform ID.

      • parent_id The ID of the parent object.

      • regularity The sorting order used in the interface.

      • roles The user's roles.

      • status The status of the object. Acceptable values:

                   - sync: Synchronized.

                   - pending: In the process of being sent.

  • links URLs linked to the object.

    • self The URL of the current object.
  • meta The object contains metadata.

    • fields An 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"
    ]
  }
}