Documents are a core concept in the First AML platform. Individuals, Entities and Cases can all have a list of associated documents. Documents have a type, and in some cases may have other associated metadata.
A document contains a list of associated files, this allows a single document (such as an Identity document, like a drivers license) to have multiple associated files such as the front and back images, that belong to the single document.
Here is an example query fragment for retrieving a document and its associated files:
documents {
type
files {
documentId
fileExtension
fileTitle
contentsUrl
}
}
To retrieve the contents of the file you must make an authenticated request to the contentsUrl
property return in the response by passing in the Authorization: Bearer ...
header, as you do with each /graphql
endpoint request.
The contentsUrl
url when fetched via a GET request may return a 30x redirect response, pointing to a new location. Your API client code needs to be configured to follow any redirects. However you do not have to pass the Authorization
header to any of those subsequent redirect requests.