---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.3
alternate:
  - https://yandex.com/dev/partner-objects/doc/en/reference/get-resource-id-object-id-relationships-resource-id.md
  - https://yandex.com/dev/partner-objects/doc/ru/reference/get-resource-id-object-id-relationships-resource-id.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/partner-objects/doc/en/llms.txt


# GET/{resource-id1}/{object-id}/relationships/{resource-id2}

Returns objects that are related to the specified object.

## Request format {#input}

```
GET https://jsonapi.partner2.yandex.com/vX/{resource-id1}/{object-id}/relationships/{resource-id2}
```

#|
|| **Parameter** | **Description** ||
|| `resource-id1`
| ID of the first resource.
||
|| `object-id`
| ID of an object that belongs to the first resource.
||
|| `resource-id2`
| ID of the second resource. The list of objects for the second resource is searched for objects that are related to the specified object.
||
|#

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 {#output-structure}

## JSON

```json
{
  "data": [
    {
      "id": "{string}",
      "type": "{string}"
    }
  ],
  "links": {
    "related": "{string}",
    "self": "{string}"
  }
}      
```

## Response parameters {#spec-output}

- **data** Related objects.

  - **id** ID of a related object.

  - **type** Resource type.

- **links** References to objects related to the specified object.

  - **related** Reference to a list of related objects with parameters.

  - **self** Reference to a list of related objects.

<!--
```
<tree ><tree-item ><tree-itemname >data</tree-itemname><tree-itemdesc >
Связанные объекты.
</tree-itemdesc><tree-item ><tree-itemname >id</tree-itemname><tree-itemdesc >
Идентификатор связанного объекта.
</tree-itemdesc></tree-item><tree-item ><tree-itemname >type</tree-itemname><tree-itemdesc >
Тип ресурса.
</tree-itemdesc></tree-item></tree-item><tree-item ><tree-itemname >links</tree-itemname><tree-itemdesc >
Ссылки на объекты, связанные с указанным объектом.
</tree-itemdesc><tree-item ><tree-itemname >related</tree-itemname><tree-itemdesc >
Ссылка на список связанных объектов с параметрами.
</tree-itemdesc></tree-item><tree-item ><tree-itemname >self</tree-itemname><tree-itemdesc >
Ссылка на список связанных объектов.
</tree-itemdesc></tree-item></tree-item></tree>
```
--> 


## Example for JSON {#example-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/relationships/context_on_site_campaign"
> ```
> 
> Response:
> 
> ```json
> 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: 326
> Connection: keep-alive{
>   "data": [{
>       "id": "882",
>       "type": "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"
>   }
> }        
> ```

