Aller au contenu

Tape un mot pour chercher dans les pages.

↑↓ Choisir↵ OuvrirÉchap Fermer
Ouvrir Portal

GET /documents

Lister les documents d’un projet

Métadonnées seulement : le fichier se télécharge depuis Portal.

Demande une clé d’API avec la portée portal:read.

Paramètres de requête

ChampTypeObligatoireDescription
project_idstringOuiIdentifiant Portal.
limitintegerNonPar défaut : 20. min. 1, max. 100.
cursorstringNon

Réponses

CodeDescriptionCorps
200Succèsobjet
400Requête invalideProblem
401Authentification requiseProblem
403Accès refuséProblem
429Trop de requêtesProblem
500Erreur interneProblem

Champs de la réponse 200

ChampTypeDescription
dataobjet[]
data[].idstringIdentifiant Portal.
data[].objectstring
data[].project_idstringIdentifiant Portal.
data[].titlestring
data[].file_namestring
data[].content_typestring
data[].sizeintegerTaille en octets. min. -9007199254740991, max. 9007199254740991.
data[].sha256string
data[].visibility“internal” | “shared”
data[].from_clientboolean
data[].created_atstringDate et heure ISO 8601 (UTC).
next_cursorstring ou nullÀ renvoyer en cursor pour la page suivante.
has_moreboolean

Exemple

curl -X GET "https://app.hgdc.ch/portal/api/v1/documents" \
-H "Authorization: Bearer $HGDC_PORTAL_API_KEY"

Réponse 200 :

{
"data": [
{
"id": "exemple",
"object": "exemple",
"project_id": "exemple",
"title": "exemple",
"file_name": "exemple",
"content_type": "exemple",
"size": -9007199254740991,
"sha256": "exemple",
"visibility": "internal",
"from_client": true,
"created_at": "exemple"
}
],
"next_cursor": "exemple",
"has_more": true
}