Skip to content

Auth Token

生成 JWT Token 用于 API 其他请求的身份验证。

端点

POST /api/v2/external/auth-token

请求头

请求头必填
Content-Typeapplication/json

请求体

字段类型必填描述
client_idstringAPI Key 标识符
client_secretstringAPI Key 密钥
json
{
  "client_id": "your-api-key-id",
  "client_secret": "your-api-key-secret"
}

示例

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"
  }'

响应 200

json
{
  "worked": true,
  "access_token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9...",
  "token_type": "Bearer",
  "expires_in": 3600
}
字段类型描述
workedboolean表示操作是否成功
access_tokenstring用于请求头的 JWT Token
token_typestring始终为 Bearer
expires_ininteger有效期(秒)(3600 = 60 分钟)

响应 401

json
{
  "worked": false,
  "detail": "Credenciais invalidas"
}

使用 Token

在所有后续请求的 Authorization 头中包含 Token:

Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9...

有效期

Token 在 60 分钟后过期。请在过期前实现自动续期。

Owem Pay Instituição de Pagamento — ISPB 37839059