Skip to main content
POST
/
api
/
v
{version}
/
auth
/
token
Cria token bearer de autenticação
curl --request POST \
  --url https://api.google.com/api:XUynQtIz/api/v{version}/auth/token \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data grant_type=client_credentials \
  --data client_id=70000006 \
  --data client_secret=password \
  --data expires_in=100
{
  "token_type": "bearer",
  "expires_in": 604800,
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}

Path Parameters

version
string
required

Body

application/x-www-form-urlencoded
grant_type
string
required

Deve ser definido como client_credentials

Example:

"client_credentials"

client_id
string
required

ID de acesso do usuário

Example:

"70000006"

client_secret
string
required

Senha do usuário

Example:

"password"

expires_in
integer<int32>

Tempo de expiração do token em segundos. Se não informado, o serviço web usará o valor padrão de 7 dias.

Example:

100

Response

Token bearer

token_type
any

Indica o tipo de token. O único tipo suportado é bearer.

Example:

"bearer"

expires_in
any

Quantidade de tempo em que o token de acesso é válido (em segundos).

Example:

31536000

access_token
any

O token de acesso solicitado.

Example:

"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjcwMDAwMDAxIiwicm9sZSI6IlByb3Zpc2lvbmluZyIsIm5iZiI6MTY4NTAyNjU2NSwiZXhwIjoxNjg1NjMxMzY1LCJpYXQiOjE2ODUwMjY1NjUsImlzcyI6IlNlY3VyZUFwaSIsImF1ZCI6IlNlY3VyZUFwaVVzZXIifQ.n-bCYU0ooHE6vR3dsWvXRUXHNK6Rt_QR8PpNIOoX4bY"

error
any

Uma string de código de erro

Example:

"unauthorized_client"