Custody
This API allows the custody of files with the following characteristics:
- Supported file types: PDF
- Custody time: 5 years
Usage
Obtaining upload and download URLs
In order to upload a file it will be necessary to obtain the upload URL. To obtain it make the following request:
curl --location '{IDENTITY_API_BASE_URL}/services/custody/upload' \
--header 'x-api-key: {API_KEY}'
Example response:
200 OK
Content-Type: application/json
{
"uploadUrl": "{UPLOAD_URL}",
"downloadUrl": "{DOWNLOAD_URL}"
}
| Field | Description |
|---|---|
| uploadUrl | File upload URL. Valid for 5 minutes. |
| downloadUrl | Pre-signed file download URL. Valid for 5 years. |
Document upload
To upload a document after obtaining the upload URL:
curl --location --request PUT '{UPLOAD_URL}' \
--header 'Content-Type: application/pdf' \
--data '{FILE_LOCATION}'
Example response:
200 OK
Document download
To download a file using the download URL:
curl --location '{DOWNLOAD_URL}'
Example response:
302 FOUND
Content-Type: application/pdf
Location: {DIRECT_DOWNLOAD_URL}
nota
When using the download URL in a browser, the browser will follow the redirection transparently to the user.
precaución
The download URL contains a JWT token, valid for 5 years. If the download URL is lost, it will not be possible to recover the file.