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

ID of the resource where the object is located.

object-id

The ID of the object to perform the action on.

action-name

The action to perform with the object

Restriction.

The allowed values depend on the resource that the object belongs to. They are listed in the actions parameter for 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 Array with information for the specified object.

    • 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 Object parameters.

  • meta This object contains meta information.

    • fields Object parameters.
  • links Links associated with the object.

    • self Reference to 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"
  }
}