Relationship Search¶
These requests search for StudyUnits that are contained with a SubGroup with known identification. The first option gets only the identification information of the results; the second option also gets metadata about each result.
Option 1: retrieve identifiers only¶
Request¶
Request Type |
POST |
URL |
/api/v1/_query/relationship/bysubject |
{
"ItemTypes": [
"30ea0200-7121-4f01-8d21-a931a182b86d"
],
"TargetItem": {
"AgencyId": "example.org",
"Identifier": "e0034aac-4fc2-4761-b6f3-a39ec7e7f320",
"Version": 1
},
"UseDistinctResultItem": true,
"UseDistinctTargetItem": true
}
The identifier 30ea0200-7121-4f01-8d21-a931a182b86d is the item type identifier for the StudyUnit item type.
The specified AgencyId, Identifier, and Version are the known identification information for a SubGroup.
See Item Type Identifiers for a list of identifiers for all item types.
Response¶
[
{
"Item1": {
"Item1": "897d02b7-8fae-4a27-93b6-5c0b4ec74536",
"Item2": 1,
"Item3": "example.org"
},
"Item2": "30ea0200-7121-4f01-8d21-a931a182b86d"
},
{
"Item1": {
"Item1": "3e57b9e1-cb8f-4fa5-9446-7ed0e9e1a95a",
"Item2": 1,
"Item3": "example.org"
},
"Item2": "30ea0200-7121-4f01-8d21-a931a182b86d"
},
{
"Item1": {
"Item1": "b733fe8f-cadf-4769-8495-86fdb6fa4d84",
"Item2": 1,
"Item3": "example.org"
},
"Item2": "30ea0200-7121-4f01-8d21-a931a182b86d"
},
{
"Item1": {
"Item1": "890c4fe8-036c-4a9c-a5e2-c648ca65eb32",
"Item2": 1,
"Item3": "example.org"
},
"Item2": "30ea0200-7121-4f01-8d21-a931a182b86d"
}
]
Note
The property names returned in the response will be improved in a future API version. For each result, they can be interpreted as follows:
Item1 (outer property)
Item1: the UUID of the result
Item2: the version number of the result
Item3: the agency identifier of the result
Item2: an identifier that indicates the item type of the result.
Option 2: retrieve metadata about each result¶
Request¶
Request Type |
POST |
URL |
TODO |
{
"ItemTypes": [
"30ea0200-7121-4f01-8d21-a931a182b86d"
],
"TargetItem": {
"AgencyId": "example.org",
"Identifier": "e0034aac-4fc2-4761-b6f3-a39ec7e7f320",
"Version": 1
},
"UseDistinctResultItem": true,
"UseDistinctTargetItem": true
}
This is the same request body as in option 1.
Response¶
[
{
"VersionRationale": {},
"Summary": {},
"ItemName": {
"en-US": "Round 1"
},
"Label": {},
"Description": {},
"ItemType": "30ea0200-7121-4f01-8d21-a931a182b86d",
"AgencyId": "example.org",
"Version": 1,
"Identifier": "897d02b7-8fae-4a27-93b6-5c0b4ec74536",
"VersionDate": "0001-01-01T00:00:00",
"VersionResponsibility": null,
"IsPublished": false,
"IsDeprecated": false,
"Tags": []
},
{
"VersionRationale": {},
"Summary": {},
"ItemName": {
"en-US": "Round 2"
},
"Label": {},
"Description": {},
"ItemType": "30ea0200-7121-4f01-8d21-a931a182b86d",
"AgencyId": "example.org",
"Version": 1,
"Identifier": "3e57b9e1-cb8f-4fa5-9446-7ed0e9e1a95a",
"VersionDate": "0001-01-01T00:00:00",
"VersionResponsibility": null,
"IsPublished": false,
"IsDeprecated": false,
"Tags": []
},
{
"VersionRationale": {},
"Summary": {},
"ItemName": {
"en-US": "Round 3"
},
"Label": {},
"Description": {},
"ItemType": "30ea0200-7121-4f01-8d21-a931a182b86d",
"AgencyId": "example.org",
"Version": 1,
"Identifier": "b733fe8f-cadf-4769-8495-86fdb6fa4d84",
"VersionDate": "0001-01-01T00:00:00",
"VersionResponsibility": null,
"IsPublished": false,
"IsDeprecated": false,
"Tags": []
},
{
"VersionRationale": {},
"Summary": {},
"ItemName": {
"en-US": "Round 4"
},
"Label": {},
"Description": {},
"ItemType": "30ea0200-7121-4f01-8d21-a931a182b86d",
"AgencyId": "example.org",
"Version": 1,
"Identifier": "890c4fe8-036c-4a9c-a5e2-c648ca65eb32",
"VersionDate": "0001-01-01T00:00:00",
"VersionResponsibility": null,
"IsPublished": false,
"IsDeprecated": false,
"Tags": []
}
]