Download
Downloading a document is a 2-step process:
- Request a temporary URL to download the document
- Download the document from the returned URL
Request a download
The following mutation requests a URL to download a document:
Example
query DocumentDownloadUrl {
downloadDocument(
documentId: "RE1TRG9jdW1lbnQ6OA=="
) {
document{
name
}
url
}
}It is possible to extend the default expiry of the returned url with the optional expiresIn parameter (see our downloadDocument API Reference):
{
"data": {
"downloadDocument": {
"document": {
"name": "course-introduction.pdf"
},
"url": "https://test.example.com/path/to/document"
}
}
}Perform the download
A HTTP GET request can then be issued on the given url to retrieve the contents:
curl --location 'https://test.example.com/path/to/document'