Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

autenticaçãoPara utilizar as APIs da Maplink, é necessário gerar um bearer token a partir das credenciais únicas de cada cliente.

Cada bearer token tem a duração de 60 minutos e poderá ser usado por qualquer API. Após este intervalo é necessário gerar um novo.

Abaixo um exemplo de credenciais únicas que devem ser usadas em body na geração do bearer token:

client_id: 0wf*************************eqFG

client_secret: 1b***********owE

Com o client_id e client_secret, utilizar o seguinte endpoint para obter o bearear token:

Code Block
languagehtml
https://api.maplink.global/oauth/client_credential/accesstoken?grant_type=client_credentials

Exemplo da request:

curl -X POST "https://api.maplink.global/oauth/client_credential/accesstoken?grant_type=client_credentials" -H "Content-Type: application/x-www-form-urlencoded" --data-urlencode "client_id=0wf*************************eqFG" --data-urlencode "client_secret=1b***********owE"

Exemplo da response:

O "access_token" : "XBlgpdua80eonaU7FmRjhRsjMe3c", é o que deverá ser usado para autenticar as requisições das outras APIs.

Code Block
languagejson
{
  "refresh_token_expires_in" : "0",
  "api_product_list" : "[Matrix, Restriction Zone, Trip, Planning, Toll, Place, Geocode, Toll Search]",
  "api_product_list_json" : [ "Matrix", "Restriction Zone", "Trip", "Planning", "Toll", "Place", "Geocode", "Toll Search" ],
  "organization_name" : "lbslocal",
  "developer.email" : "abcde@abcde.com",
  "token_type" : "BearerToken",
  "issued_at" : "1620249207151",
  "client_id" : "0wf*************************eqFG",
  "access_token" : "XBlgpdua80eonaU7FmRjhRsjMe3c",
  "application_name" : "49136471-81b0-4f23-bfff-980f0337f01e",
  "scope" : "",
  "expires_in" : "3599",
  "refresh_count" : "0",
  "status" : "approved"
}