Skip to content

Auth Token

Genere un token JWT pour l'authentification dans les autres requetes de l'API.

Endpoint

POST /api/v2/external/auth-token

En-tetes

En-teteValeurObligatoire
Content-Typeapplication/jsonOui

Request Body

ChampTypeObligatoireDescription
client_idstringOuiIdentifiant de l'API Key
client_secretstringOuiCle secrete de l'API Key
json
{
  "client_id": "votre-api-key-id",
  "client_secret": "votre-api-key-secret"
}

Exemple

bash
curl -X POST https://api.owem.com.br/api/v2/external/auth-token \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": "votre-api-key-id",
    "client_secret": "votre-api-key-secret"
  }'

Reponse 200

json
{
  "worked": true,
  "access_token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9...",
  "token_type": "Bearer",
  "expires_in": 3600
}
ChampTypeDescription
workedbooleanIndique le succes de l'operation
access_tokenstringToken JWT a utiliser dans les en-tetes
token_typestringToujours Bearer
expires_inintegerValidite en secondes (3600 = 60 minutes)

Reponse 401

json
{
  "worked": false,
  "detail": "Identifiants invalides"
}

Utilisation du Token

Incluez le token dans l'en-tete Authorization de toutes les requetes suivantes :

Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9...

Validite

Le token expire dans 60 minutes. Implementez un renouvellement automatique avant l'expiration.

Owem Pay Instituição de Pagamento — ISPB 37839059