Aller au contenu

Tape un mot pour chercher dans les pages.

↑↓ Choisir↵ OuvrirÉchap Fermer
Ouvrir Portal

Référence des endpoints

Routes GET /projects, GET /projects/{id}.

GET /projects

Lister les projets de l’espace

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

Paramètres de requête

ChampTypeObligatoireDescription
status“active” | “paused” | “done” | “archived”Non
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[].namestring
data[].status“active” | “paused” | “done” | “archived”
data[].client_idstringIdentifiant Portal.
data[].descriptionstring ou null
data[].websitestring ou null
data[].created_atstringDate et heure ISO 8601 (UTC).
data[].updated_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/projects" \
-H "Authorization: Bearer $HGDC_PORTAL_API_KEY"

Réponse 200 :

{
"data": [
{
"id": "exemple",
"object": "exemple",
"name": "exemple",
"status": "active",
"client_id": "exemple",
"description": "exemple",
"website": "exemple",
"created_at": "exemple",
"updated_at": "exemple"
}
],
"next_cursor": "exemple",
"has_more": true
}

GET /projects/{id}

Lire un projet

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

Paramètres de chemin

ChampTypeObligatoireDescription
idstringOui

Réponses

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

Champs de la réponse 200

ChampTypeDescription
idstringIdentifiant Portal.
objectstring
namestring
status“active” | “paused” | “done” | “archived”
client_idstringIdentifiant Portal.
descriptionstring ou null
websitestring ou null
created_atstringDate et heure ISO 8601 (UTC).
updated_atstringDate et heure ISO 8601 (UTC).

Exemple

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

Réponse 200 :

{
"id": "exemple",
"object": "exemple",
"name": "exemple",
"status": "active",
"client_id": "exemple",
"description": "exemple",
"website": "exemple",
"created_at": "exemple",
"updated_at": "exemple"
}