Refreshing Access Token

How to refresh Trans.eu API access_token using refresh_token.

Impor­tant note: To uti­lize this authen­ti­ca­tion flow your appli­ca­tion must have refresh_token grant type admit­ted.

Access token request

Exam­ple

  • Method: POST
  • URL: /ex­t/auth-api/ac­counts/­to­ken
  • Host: api.platform.trans.eu
  • Con­tent-Type: appli­ca­tion/x‑www-form-urlen­cod­ed

Request parameters

Descrip­tion of query para­me­ters required dur­ing token refresh.

NameRequiredTypeDescrip­tion
grant_typeyesstringMust be set to refresh_token.
refresh_tokenyesstringThe refresh token issued dur­ing autho­riza­tion.
client_idyesstringAppli­ca­tion client_id obtained dur­ing reg­is­tra­tion. Only required if Autho­riza­tion head­er is not sent.
client_secretyesstringAppli­ca­tion client_secret obtained dur­ing reg­is­tra­tion. Only required if Autho­riza­tion head­er is not sent.

Header parameters

Name Required Val­ue
Con­tent-Typeyesappli­ca­tion/x‑www-form-urlen­cod­ed
Api-keyyesApi-key obtained dur­ing reg­is­tra­tionAc­cess token response

Example response

HTTP/1.1 200 OK
Content-Type: application/json
{
  "access_token": "59d9aa9b15cd59a61fc52014792efb6caa82373b",
  "expires_in": 21599,
  "token_type": "Bearer",
  "refresh_token": "d52d1d998d6533a3be8e7f26f904be513287938b"
}

Response parameters

NameDescrip­tion
access_tokenAccess token to use by appli­ca­tion for autho­riza­tion.
expires_inTime in sec­onds until token expires.
token_typeType Bear­er is returned as defined in rfc6749.
refresh_tokenSin­gle serv­ing token that can be used to extend life­time of access token.