Clés API
Format des jetons
Créer une clé — POST /v1/me/keys
curl -sS "https://albert.api.etalab.gouv.fr/v1/me/keys" \
-H "Authorization: Bearer $ALBERT_EXISTANT" \
-H "Content-Type: application/json" \
-d '{"name": "ci-github", "expires": null}'import os
import requests
resp = requests.post(
"https://albert.api.etalab.gouv.fr/v1/me/keys",
headers={
"Authorization": f"Bearer {os.environ['ALBERT_EXISTANT']}",
"Content-Type": "application/json",
},
json={"name": "ci-github", "expires": None},
)
resp.raise_for_status()
print(resp.json())const resp = await fetch("https://albert.api.etalab.gouv.fr/v1/me/keys", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ALBERT_EXISTANT}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ name: "ci-github", expires: null }),
});
if (!resp.ok) throw new Error(await resp.text());
console.log(await resp.json());Lister les clés — GET /v1/me/keys
Détail — GET /v1/me/keys/{key}
Révoquer — DELETE /v1/me/keys/{key}
Last updated
Was this helpful?