Get paginated list of relationships via query

post/relationships
Internal-Use Only

Returns a paginated collection of relationships. Standard paging, filtering, and sorting options are provided. The media type of the returned items in the collection is application/vnd.sas.relationship+json. This call is an extended GET operation and therefore idempotent.

Request Samples

1

Response Samples

1{
2 "version": 2,
3 "accept": "application/vnd.sas.relationship",
4 "count": 1,
5 "start": 0,
6 "limit": 10,
7 "name": "items",
8 "items": [
9 {
10 "creationTimeStamp": "2022-11-19T02:55:55.675000Z",
11 "createdBy": "etladm",
12 "modifiedTimeStamp": "2022-11-19T02:55:55.675000Z",
13 "modifiedBy": "etladm",
14 "id": "3f72e77b-1966-487e-8ada-d89c69c92807",
15 "links": [
16 {
17 "method": "GET",
18 "rel": "self",
19 "href": "/relationships/relationships/3f72e77b-1966-487e-8ada-d89c69c92807",
20 "uri": "/relationships/relationships/3f72e77b-1966-487e-8ada-d89c69c92807",
21 "type": "application/vnd.sas.relationship"
22 },
23 {
24 "method": "DELETE",
25 "rel": "delete",
26 "href": "/relationships/relationships/3f72e77b-1966-487e-8ada-d89c69c92807",
27 "uri": "/relationships/relationships/3f72e77b-1966-487e-8ada-d89c69c92807"
28 },
29 {
30 "method": "PUT",
31 "rel": "update",
32 "href": "/relationships/relationships/3f72e77b-1966-487e-8ada-d89c69c92807",
33 "uri": "/relationships/relationships/3f72e77b-1966-487e-8ada-d89c69c92807",
34 "type": "application/vnd.sas.relationship",
35 "responseType": "application/vnd.sas.relationship"
36 },
37 {
38 "method": "GET",
39 "rel": "up",
40 "href": "/relationships/relationships",
41 "uri": "/relationships/relationships",
42 "type": "application/vnd.sas.collection",
43 "itemType": "application/vnd.sas.relationship"
44 }
45 ],
46 "resourceUri": "/containers/containerUri",
47 "type": "Associated",
48 "relatedResourceUri": "/terms/term1Uri",
49 "referenceId": "228dff66-0b62-4217-b686-a62ef881228a",
50 "relatedReferenceId": "fdbdfe27-75f6-4623-96bf-fc744258c38a",
51 "version": 1
52 }
53 ],
54 "links": [
55 {
56 "method": "GET",
57 "rel": "self",
58 "href": "/relationships/relationships?start=0&limit=10&sortBy=id&depth=2&direction=both",
59 "uri": "/relationships/relationships?start=0&limit=10&sortBy=id&depth=2&direction=both",
60 "type": "application/vnd.sas.collection",
61 "itemType": "application/vnd.sas.relationship"
62 },
63 {
64 "method": "GET",
65 "rel": "collection",
66 "href": "/relationships/relationships",
67 "uri": "/relationships/relationships",
68 "type": "application/vnd.sas.collection",
69 "itemType": "application/vnd.sas.relationship"
70 },
71 {
72 "method": "GET",
73 "rel": "up",
74 "href": "/relationships",
75 "uri": "/relationships",
76 "type": "application/vnd.sas.api"
77 },
78 {
79 "method": "POST",
80 "rel": "create",
81 "href": "/relationships/relationships",
82 "uri": "/relationships/relationships",
83 "type": "application/vnd.sas.relationship",
84 "responseType": "application/vnd.sas.relationship"
85 }
86 ]
87}

Query Parameters

NameTypeRequiredDescription
limit
integer<int32>
false

The maximum number of items to return in this request.

Default:
10
start
integer<int64>
false

The 0-based start index of a paginated request.

Default:
0
sortBy
string<sort-criteria>
false

The sort criteria supports the following fields in ascending or descending order: id, type, resourceUri, referenceId, relatedResourceUri, relatedReferenceId, source, modifiedTimeStamp, creationTimeStamp, createdBy, modifiedBy.

Default:
name

Request Body

relationshipQuery

A relationship query using POST.

NameTypeRequiredDescription
resourceUri
array [string]
false

The subject or subjects for which to get relationships.

referenceId
array [string]
false

The ID of subject or subjects for which to get relationships.

depth
integer
false

The value used to control how deep to traverse the relationships tree. A value greater than 1 implies a recursive traversal through the list of related resources up to the specified depth. A value of -1 will result in all relationships for all resources returned. The default setting is 1, which implies only direct relationships of the resource will be returned.

direction
string
false

The value used to control the direction of the relationships returned. A relationship is defined as resource uri "to" related resource uri. A value of "from" will return relationships where the resource(s) indicated by the resourceUri or referenceId parameter is the related resource. A value of "both" will return all relationships that include the resource(s) indicated by the resourceUri or referenceId parameter.

filter
string
false

An expression for filtering the collection. Valid expressions include eq(member,"string"). Allowed members are id, resourceUri, type, relatedResourceUri, source, and resource.type. The resource.type criteria is applied to each resource and related resource. When depth > 1, the relationship type and resource.type criteria are applied at each level. Relationships that are filtered out for a given level are not used to search the next level.

Responses

StatusMeaningDescription
200OKOk.HeadersSchema
400Bad RequestBad request (the request is not well-formed).Schema