Aller au contenu

Tape un mot pour chercher dans les pages.

↑↓ Choisir↵ OuvrirÉchap Fermer
Ouvrir Portal

Référence des endpoints

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

GET /clients

Lister les clients de l’espace

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

Paramètres de requête

ChampTypeObligatoireDescription
archived“true” | “false”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[].emailstring ou null
data[].contact_namestring ou null
data[].websitestring ou null
data[].idestring ou nullNuméro IDE (CHE-…).
data[].addressobjet ou null
data[].archivedboolean
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/clients" \
-H "Authorization: Bearer $HGDC_PORTAL_API_KEY"

Réponse 200 :

{
"data": [
{
"id": "exemple",
"object": "exemple",
"name": "exemple",
"email": "exemple",
"contact_name": "exemple",
"website": "exemple",
"ide": "exemple",
"address": {
"name": "exemple",
"street": "exemple",
"building_number": "exemple",
"extra": "exemple",
"zip": "exemple",
"city": "exemple",
"country": "exemple"
},
"archived": true,
"created_at": "exemple"
}
],
"next_cursor": "exemple",
"has_more": true
}

GET /clients/{id}

Lire un client

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
emailstring ou null
contact_namestring ou null
websitestring ou null
idestring ou nullNuméro IDE (CHE-…).
addressobjet ou null
archivedboolean
created_atstringDate et heure ISO 8601 (UTC).

Exemple

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

Réponse 200 :

{
"id": "exemple",
"object": "exemple",
"name": "exemple",
"email": "exemple",
"contact_name": "exemple",
"website": "exemple",
"ide": "exemple",
"address": {
"name": "exemple",
"street": "exemple",
"building_number": "exemple",
"extra": "exemple",
"zip": "exemple",
"city": "exemple",
"country": "exemple"
},
"archived": true,
"created_at": "exemple"
}