Saltar al contingut principal
GET

Descarregar un fitxer d'un document entrant

Scope:inbox:inbox.read
https://api.holded.com/api/v2/inbox/{incomingDocumentId}/files/{filename}/download

Returns the raw content of a file attached to an incoming document. Use `?variant=inline` to display the file in-browser with 24-hour caching instead of triggering a download.

Paràmetres

Paràmetres de ruta

incomingDocumentIdstringobligatori

ID del document entrant (ObjectId hexadecimal de 24 caràcters)

filenamestringobligatori

Nom del fitxer a descarregar

Paràmetres de consulta

variantstringopcional= download

Mode de lliurament: download (adjunt) o inline (visualització amb memòria cau)

"download""inline"

Petició

python
import requests

url = "https://api.holded.com/api/v2/inbox/507f1f77bcf86cd799439011/files/document.pdf/download?variant=download"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Accept": "application/json",
}

response = requests.get(url, headers=headers)
print(response.json())

Respostes

Resposta

json
"string"

Respostes exitoses

200Contingut del fitxerapplication/octet-stream
string<binary>

Respostes d'error

401API key no vàlida o no proporcionadaapplication/json
403Permisos insuficientsapplication/json
404Document o fitxer no trobatapplication/json
429Límit de sol·licituds exceditapplication/json