POST/{resource-id}/{object-id}/action/{action-name}

Performs the specified action with the object.

Request format

POST https://jsonapi.partner2.yandex.com/vX/{resource-id}/{object-id}/action/{action-name}

Parameter

Description

resource-id

The ID of the resource that hosts the object.

object-id

The ID of the object to perform the action on.

action-name

The action to perform with the object.

Restriction.

The acceptable values depend on the resource hosting the object. They are listed in the actions parameter of the GET/{resource-id}/{object-id} operation.

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

{
  "data": 
  {
    "relationships": {
      "{string}": {
        "links": {
          "related": "{string}",
          "self": "{string}"
        }
      }
    },
    "id": "{string}",
    "type": "{string}",
    "attributes": {}
  },
  "meta": {
    "fields": []
  },
  "links": {
    "self": "{string}"
  }
}    

Response parameters

  • 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 The resource type.

    • attributes The parameters of the object.

  • meta The object contains metadata.

    • fields The parameters of the object.
  • links URLs linked to the object.

    • self The URL of the current object.

Example for JSON

Request:

curl -i -g -H "Accept: application/vnd.api+json" -H "Content-Type: application/vnd.api+json" -H "Authorization: token 66.." -X POST 'https://jsonapi.partner2.yandex.com/v1/context_on_site_rtb/R-A-1056-1/action/duplicate'

Response:

HTTP/1.1 200 OK
Server: nginx/1.8.1
Date: Wed, 18 Jan 2017 17:33:25 GMT
Content-Type: application/vnd.api+json
Content-Length: 757
Connection: keep-alive

{
  "data": 
  {
    "relationships": {
      "context_on_site_campaign": {
        "links": {
          "related": "https://jsonapi.partner2.yandex.com/v1/context_on_site_rtb/R-A-1056-2/context_on_site_campaign",
          "self": "https://jsonapi.partner2.yandex.com/v1/context_on_site_rtb/R-A-1056-2/relationships/context_on_site_campaign"
        }
      },
      "pages": {
        "links": {
          "related": "https://jsonapi.partner2.yandex.com/v1/context_on_site_rtb/R-A-1056-2/pages",
          "self": "https://jsonapi.partner2.yandex.com/v1/context_on_site_rtb/R-A-1056-2/relationships/pages"
        }
      }
    },
    "id": "R-A-1056-2",
    "type": "context_on_site_rtb",
    "attributes": {}
  },
  "meta": {
    "fields": []
  },
  "links": {
    "self": "https://jsonapi.partner2.yandex.com/v1/context_on_site_rtb/R-A-1056-2"
  }
}