Documentation / Jetons OAuth

Jetons OAuth

Endpoints de la ressource Jetons OAuth. Tous les appels exigent une authentification et renvoient l’enveloppe JSON standard.

🔗

URL de base: https://companybelgium.be/api · Authentification

Obtain an access token#

POST/oauth/token

OAuth2 client_credentials grant for developer applications. Returns a bearer token usable as an alternative to the X-API-Key / X-API-Secret headers.

Corps (form)

grant_type=client_credentials
client_id=app_xxx
client_secret=secret_xxx

Requête

curl -X POST https://companybelgium.be/api/oauth/token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d grant_type=client_credentials \
  -d client_id=app_xxx \
  -d client_secret=secret_xxx
const res = await fetch("https://companybelgium.be/api/oauth/token", {
  method: "POST",
  headers: { "Content-Type": "application/x-www-form-urlencoded" },
  body: new URLSearchParams({"grant_type":"client_credentials","client_id":"app_xxx","client_secret":"secret_xxx"}),
});
const { data } = await res.json();

Réponse

{
  "success": true,
  "data": {
    "access_token": "eyJhbGciOi...redacted",
    "token_type": "Bearer",
    "expires_in": 3600
  },
  "error": null,
  "timestamp": "2026-06-05T09:00:00.000Z",
  "meta": null
}