Get headers for other documents related to an individual document
For a given document and relationship type name, finds all the documents that are related to the given document according to the given relationship type.
Since the child documents of a top-level document are related to it by a special kind of relationship type, this endpoint can be used
to fetch children of a document. In this case, the name of the relationship type is identical to the child entity type, so use
the child entity type name as the relationshipTypeName
path parameter.
The related documents can be filtered by a date range using the date and time fields on the entity type of the related document.
It is important to clarify that there are two entity types to consider: the entity type that is specified in the path and the related entity type that is returned. Distinguishing between the two is important when filtering by a date range.
For example, assume there is a relationship type defined between an entity type named "entityTypeA" and another entity type named "entityTypeB" that is called "fromAToB". For the request GET /documents/entityTypeA/{documentId}/fromAtoB, "entityTypeB" is the related entity type and a collection of "entityTypeB" documents are returned.
The number of related documents can be filtered by fields on the related entity type using a combination of the "earliestValidFrom", "latestValidFrom", "earliestValidTo", "latestValidTo", "dateFieldName", "earliestDate", and "latestDate" parameters. Each of these parameters refer to a Date, Timestamp, or Timestamp With Time Zone field on the related entity type.
When using the "earliestValidFrom" and "latestValidFrom" parameters, the results are filtered by the field name that is specified in the "validFromFieldName" property in the related entity type.
When using the "earliestValidTo" and "latestValidTo" parameters, the results are filtered by the field name that is specified in the "validToFieldName" property in the related entity type.
The "dateFieldName" parameter is used to specify an arbitrary Date, Timestamp, or Timestamp With Time Zone field name on the related entity type. When specified, include "earliestDate", "latestDate", or both parameters.
Name | Type | Required | Description |
---|---|---|---|
documentId | string | true | The ID for the document. |
entityTypeName | string | true | The name of the entity type to which the document belongs. |
relationshipTypeName | string | true | The name of a relationship type that is associated with the entity type name defined in the parameter "entityTypeName". |
Name | Type | Required | Description |
---|---|---|---|
dateFieldName | string | false | An arbitrary Date, Timestamp, or Timestamp With Time Zone field in the related entity type. If a value is provided, the field with this name is used to filter documents against the given "earliestValidFrom", "earliestValidTo", "latestValidFrom", and "latestValidTo" parameters. |
earliestValidFrom | string<date-time> | false | The earliest value that is allowed for the related entity's "Valid From" date or timestamp field. If the "Valid From" field is a Date field, a date value with no timestamp is allowed. Otherwise, use an ISO-8601 timestamp value. By default, the field configured as the "validFromField" in the document's entity type is used for filtering. If the query parameter "dateFieldName" is provided, the field that is specified there overrides the entity type's configuration, and that field is used instead. |
earliestValidTo | string<date-time> | false | The earliest value that is allowed for the related document's "Valid To" date or timestamp field. If the "Valid To" field is a Date field, a date value with no timestamp is allowed. Otherwise, use an ISO-8601 timestamp value. By default, the field configured as the "validToField" in the document's entity type is used for filtering. If the query parameter "dateFieldName" is provided, the field that is specified there overrides the entity type's configuration, and that field is used instead. |
latestValidFrom | string<date-time> | false | The latest value that is allowed for the related document's "Valid From" date or timestamp field. If the "Valid From" field is a Date field, a date value with no timestamp is allowed. Otherwise, use an ISO-8601 timestamp value. By default, the field configured as the "validFromField" in the document's entity type is used for filtering. If the query parameter "dateFieldName" is provided, the field that is specified there overrides the entity type's configuration, and that field is used instead. |
latestValidTo | string<date-time> | false | The latest value that is allowed for the related document's "Valid To" date or timestamp field. If the "Valid To" field is a Date field, a date value with no timestamp is allowed. Otherwise, use an ISO-8601 timestamp value. By default, the field configured as the "validToField" in the document's entity type is used for filtering. If the query parameter "dateFieldName" is provided, the field that is specified there overrides the entity type's configuration, and that field is used instead. |
limit | integer | false | The maximum number of documents to return in this page of results. The actual number of returned documents is fewer if the collection is exhausted. Default: 40 |
start | integer | false | The starting index of the first document in a page. Default: 0 |
Name | Type | Required | Description |
---|---|---|---|
Accept-Item | string | false | The media type that the client accepts for items within the response collection. Allowed values: application/jsonapplication/vnd.sas.investigation.data.documentapplication/vnd.sas.investigation.data.document+jsonapplication/vnd.sas.investigation.data.masked.documentapplication/vnd.sas.investigation.data.masked.document+jsonapplication/vnd.sas.investigation.data.minimally.masked.documentapplication/vnd.sas.investigation.data.minimally.masked.document+json |
Status | Meaning | Description | ||
---|---|---|---|---|
200 | OK | The request succeeded. | ||
404 | Not Found | No documents were found that are associated with the given documents and relationship type | ||
415 | Unsupported Media Type | The endpoint cannot produce collection items of the type specified in the `Accept-Item` header. |