Get relations between two objects
Learn how to retrieve relationships between two entities.
This operation fetches all relations between two entities filtered by relationTypes.
relationTypes from the request, the operation returns all relations. Request
POST {TenantURL}/relations/getByObjectUris| Parameter | Required | Details | |
|---|---|---|---|
| Headers | Authorization
                         | Yes | Information about authentication access token in format "Bearer <accessToken>" (see details in Authentication API ).  | 
| Query | options | No | Comma-separated list of options which affect relation's JSON content in the response. Available options: 
  | 
| Body | Yes | JSON object specifying relation filter criteria. This object supports the following fields: 
  | |
Example
This example shows how to retrieve a HasAddress relation between two entities.
POST {TenantURL}/relations/getByObjectUris
Headers: Authorization: Bearer ...
{
  "objectUris": [
    "entities/0000Dqr",
    "entities/00009ab"
  ],
  "relationTypes": [
    "configuration/relationTypes/HasAddress"
  ]
}
            [
    {
        "index": 0,
        "object": {
            "uri": "relations/0000Aef",
            "type": "configuration/relationTypes/HasAddress",
            "startObject": {
                "objectURI": "entities/0000Dqr",
                "uri": "relations/0000Aef/startObject",
                "type": "configuration/entityTypes/HCP",
                "label": "Other  Person",
                "directionalLabel": "has address"
            },
            "endObject": {
                "objectURI": "entities/00009ab",
                "uri": "relations/0000Aef/endObject",
                "type": "configuration/entityTypes/Location",
                "label": "2501 N Orange Ave Ste 589   ",
                "directionalLabel": "locates"
            },
            "attributes": {},
            "crosswalks": [
                {
                    "uri": "relations/0000Aef/crosswalks/18D",
                    "type": "configuration/sources/LNKD",
                    "value": "123",
                    "createDate": "2025-01-28T20:24:34.625+04:00",
                    "updateDate": "2025-01-28T20:24:34.625+04:00",
                    "attributes": [],
                    "singleAttributeUpdateDates": {}
                }
            ],
            "ratings": [
                {
                    "userRoles": "ROLE_ADMIN,ROLE_API,ROLE_USER",
                    "comment": "BAD",
                    "value": 1,
                    "timestamp": "2025-01-28T20:30:56.253+0400",
                    "user": "masha"
                }
            ],
            "consolidatedRating": 1
        },
        "successful": true
    }
]