Créer un jeton d'accès à partir des clés d'API

POST /auth/access_token

Créer un jeton d'accès (access_token) au format JWT pour permettre les échanges entre votre serveur et l'API RPC.

Le jeton d'accès est valide 5 minutes.

application/json

Body Required

  • access_key string Required
  • secret_key string Required

Responses

  • 201 application/json

    Le jeton est créé

    Hide response attribute Show response attribute object
    • access_token string

      jeton d'accès JWT

  • 401 application/json

    Non authentifié. Le token applicatif est manquant ou invalide.

  • 403 application/json

    Non autorisé

POST /auth/access_token
curl \
 --request POST 'https://api.covoiturage.beta.gouv.fr/v3.3/auth/access_token' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"access_key":"string","secret_key":"string"}'
Request examples
{
  "access_key": "string",
  "secret_key": "string"
}
Response examples (201)
{
  "access_token": "string"
}
Response examples (401)
{
  "id": 1,
  "error": {
    "code": -32501,
    "data": "Unauthorized application",
    "message": "Unauthorized Error"
  },
  "jsonrpc": "2.0"
}
Response examples (403)
{
  "id": 1,
  "error": {
    "code": -32503,
    "data": "Invalid permissions",
    "message": "Forbidden Error"
  },
  "jsonrpc": "2.0"
}