Référence de l'API
Service
État du service et version déployée. Ces routes ne demandent pas d'authentification.
État du service
GET/healthPublic
Returns service and PostgreSQL connectivity status.
Ne demande pas d'authentification.
Réponse 200
statusstringobligatoireValeurs :
okdatabasestringobligatoireValeurs :
ok
Erreurs
400Invalid request503Service unavailable
curl https://api.autopic.io/healthconst res = await fetch('https://api.autopic.io/health', {
method: 'GET',
});
const data = await res.json();import os, requests
res = requests.get(
"https://api.autopic.io/health",
)
data = res.json()<?php
$ch = curl_init('https://api.autopic.io/health');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [],
]);
$data = json_decode(curl_exec($ch), true);{
"status": "ok",
"database": "ok"
}Version déployée
GET/versionPublic
Reports the commit the running binary was built from. Public and unauthenticated: checking what is deployed should not need the admin key.
Ne demande pas d'authentification.
Réponse 200
commitstringshortCommitstringbuildTimestringdirtybooleanBuilt from a working tree with uncommitted changes.
sourcestringWhere the commit came from.
Valeurs :
ldflags,environment,buildinfo,unavailable
curl https://api.autopic.io/versionconst res = await fetch('https://api.autopic.io/version', {
method: 'GET',
});
const data = await res.json();import os, requests
res = requests.get(
"https://api.autopic.io/version",
)
data = res.json()<?php
$ch = curl_init('https://api.autopic.io/version');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [],
]);
$data = json_decode(curl_exec($ch), true);{
"commit": "98af74ad3e1f0c2b4a5d6e7f8a9b0c1d2e3f4a5b",
"shortCommit": "98af74a",
"buildTime": "string",
"dirty": true,
"source": "ldflags"
}