Auth Token
Generates a JWT token for authentication in all other API requests.
Endpoint
POST /api/v2/external/auth-tokenHeaders
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
client_id | string | Yes | API Key identifier |
client_secret | string | Yes | API Key secret |
json
{
"client_id": "your-api-key-id",
"client_secret": "your-api-key-secret"
}Example
bash
curl -X POST https://api.owem.com.br/api/v2/external/auth-token \
-H "Content-Type: application/json" \
-d '{
"client_id": "your-api-key-id",
"client_secret": "your-api-key-secret"
}'Response 200
json
{
"worked": true,
"access_token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 3600
}| Field | Type | Description |
|---|---|---|
worked | boolean | Indicates operation success |
access_token | string | JWT token for use in headers |
token_type | string | Always Bearer |
expires_in | integer | Validity in seconds (3600 = 60 minutes) |
Response 401
json
{
"worked": false,
"detail": "Invalid credentials"
}Using the Token
Include the token in the Authorization header of all subsequent requests:
Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9...Validity
The token expires in 60 minutes. Implement automatic renewal before expiration.