Accelerate the Value of Data

Relation Search

This operation performs search for relationships.

Note: You can search Relations Records up to a maximum number of 10,000 items. Also, you may use Relations Export API for large amounts of data.

This operation performs search for relationships by its start and/or end objects, attribute values, tags, or type.

Important: Only tenants where relations indexing is enabled are able to use this API.

For additional information about relation properties that can be used in filter conditions, refer to Filtering Entities

Request - You can use one of the following endpoints to search for relations:

  • GET {TenantURL}/relations
  • GET {TenantURL}/relations/_search
  • POST {TenantURL}/relations/_search
Note: Reltio recommends that you use the POST method and pass the parameters through the request body.
Table 1. Parameters
Name Required Details Examples
Headers Authorization Yes Information about authentication access token in format "Bearer <accessToken>" (see details in Authentication API).
Query filter No Enables relations filtering by a condition. Format for filter query parameter: filter=({Condition Type}[AND/OR {Condition Type}]*). For more information see Relations Filtering.
select No This is a comma-separated list of properties from relation structure that should be returned in a response. Allows a return of the partial relationship object. You can find a list of relationship object properties under Relations API.
select=uri,startObject,endObject
max No

Positive Integer value to identify maximum number of relations to return in a response. Can be used to organize pagination in combination with "offset" parameter.

Default value depends on the tenant configuration.

max=10
offset No

Positive Integer value to identify starting what element in a result set should be returned in a response. Can be used to organize pagination in combination with "max" parameter.

Default value is 0.
Note: The updated maximum value and offset parameters, when combined, must not exceed the value of 10,000. Some examples of valid combinations are:
  • offset=9900 and max=100
  • offset=9800 and max=200
offset=120
sort No Sort parameter is used with Order parameter. Sort parameter points to the attribute or a list of attributes where ordering must be applied. If you order the result set as ascending or descending (reversed), you must use the Sort parameter to list the attributes that must be used for ordering.
Important: The sorting will not be used if this parameter is not provided or the value is not recognized.Sorting is available on multiple parameters combining the parameters using & sign. The & symbol is encoded as %26 in the request.
Sorting priority of the parameters depends on the order you have added the parameters in the request while using multiple sorting.
sort=uri

sort=uri&startObject

The result set is first sorted alphabetically by Uniform Resource Identifier (URI). The sorted result set will be sorted again by sort=startObject
order No Order of sorting. Can be used in combination with the sort parameter to have the reverse order.

Possible values:

  • asc: results are shown in ascending order
  • desc: results are shown in descending order

Default sorting is by relation asc.

order=desc
options No

This is a comma-separated list of different options that have an affect on a relation's JSON content in a response.

Available options:

  • sendHidden: disabled by default, relation's JSON contain hidden attributes if this option is enabled.
  • resolveMergedEntities: false by default, returns actual winner URIs for start/end objects in the relation if set to true.
options=sendHidden,resolveMergedEntities
activeness No

Available options:

active: default value. This option allows a search among active relations

all: allows search among all (active/expired) relations

not_active: allows search among expired relations

activeness=active
Body (Only for the POST method) No Indicates the JSON body that can have all the same fields as supported in the query parameters.
Note: The query parameters have priority and override the body parameters.
{
  "filter": "(equals(startObject,'entities/1'))",
  "select": "uri,startObject,endObject",
  "max": 10,
  "offset": 120,
  "sort": "attributes.FirstName",
  "order": "desc",
  "options": "sortByOV,ovOnly",
  "activeness": "active"
}

Response

JSON array of relation objects from the tenant matching filter request.

Find all relationships

GET {TenantURL}/relations?filter=(equals(startObject,'entities/2') or equals(endObject, 'entities/2'))&max=2
Headers: Authorization: Bearer 204938ca-2cf7-44b0-b11a-1b4c59984512

Response

GET {TenantURL}/relations?filter=(equals(startObject,'entities/2') or equals(endObject, 'entities/2'))&max=2
Headers: Authorization: Bearer 204938ca-2cf7-44b0-b11a-1b4c59984512
[
    {
        "uri": "relations/20",
        ...
    },
    {
        "uri": "relations/142",
        ...
    }
]