Download File
POST
https://app.firmeasy.legal/api/v1/digital/archivo/download
Download File
Section titled “Download File”This endpoint allows you to download a specific digital file. The download is processed using the unique file identifier provided in the request body.
Authorization
Section titled “Authorization”This resource is protected. You must include your access token in the request header.
AuthorizationAccess token (Bearer token).
Limits:Obligatorio
Content-TypeSpecifies the format of the request.
Limits:application/json
Request Parameters
Section titled “Request Parameters”Required Fields
Fields marked with an asterisk (*) are required and must be provided in the request. Other fields are optional.
Send the file identifier in JSON format to initiate the download.
archivo_idUnique identifier (UUID) of the file you wish to download.
Limits:Obligatorio (Formato UUID)
Implementation Examples
Section titled “Implementation Examples”curl -X POST [https://app.firmeasy.legal/api/v1/digital/archivo/download](https://app.firmeasy.legal/api/v1/digital/archivo/download) \ -H "Authorization: Bearer TU_TOKEN_AQUI" \ -H "Content-Type: application/json" \ -d '{ "archivo_id": "1eebd53e-a10e-4ce8-a714-31ef4c8fabc0" }'Node.js (Fetch)
Section titled “Node.js (Fetch)”const myHeaders = new Headers();myHeaders.append("Authorization", "Bearer TU_TOKEN_AQUI");myHeaders.append("Content-Type", "application/json");
const raw = JSON.stringify({ "archivo_id": "1eebd53e-a10e-4ce8-a714-31ef4c8fabc0"});
const requestOptions = { method: "POST", headers: myHeaders, body: raw, redirect: "follow"};
fetch("[https://app.firmeasy.legal/api/v1/digital/archivo/download](https://app.firmeasy.legal/api/v1/digital/archivo/download)", requestOptions) .then((response) => response.blob()) // Los archivos se manejan como Blob .then((blob) => { // Lógica para descargar el archivo en el navegador/sistema console.log("Archivo recibido"); }) .catch((error) => console.error(error));Response
Section titled “Response”This endpoint returns a binary stream of the requested file.
- 200 OK: The download will start immediately.
- Headers: The response will include headers such as
Content-Type: application/pdfor similar depending on the file type.
Status Codes
Section titled “Status Codes”| Code | Status | Description |
|---|---|---|
200 |
OK | Download started successfully. |
401 |
Unauthorized | Missing or invalid token. |
404 |
Not Found | No file found with that ID. |
500 |
Server Error | Internal server failure. |
