Using Refresh Token

To obtain a new pair of tokens in case the access token expires or becomes lost, a user sends the HTTP POST request with the refresh token in the request body to the api/oauth2/token endpoint. A successfully completed operation returns the 200 response code and a new pair of tokens in the response body.

Tip

If you lose the refresh token, you can log in again under the same user account and get a new pair of tokens.

Using Refresh TokenExample

To obtain an access token and a refresh token, a user sends the HTTP POST request to the api/oauth2/token endpoint.

In the body of the request, the user specifies the following parameters:

  • grant_type — to refresh the token, it is required that the Refresh_token value must be specified for this parameter.
  • refresh_token — the previously saved refresh token.

Request:

POST https://51.11.247.127/api/oauth2/token

 

Request Body:

"Username=administrator&Password=Password&refresh_token=eyJhbGciOiJSUzUxMiIsImtpZCI6IkEyNzE5ODUzM0E0MTQyODNCNjMxRjEzRTczMTg4QTRFMDMyREU1QzAiLCJ0eXAiOiJKV1QifQ.eyJqdGkiOiIwNzFlYzJkZS03ZDY4LTRkNGEtYjIwZC0yM2Y5MmVjZjAwYmMiLCJ1bmlxdWVfbmFtZSI6IkFkbWluIiwicm9sZSI6IkFkbWluaXN0cmF0b3IiLCJuYmYiOjE2MTMxMjc5OTYsImV4cCI6MTYxNDMzNzU5NiwiaWF0IjoxNjEzMTI3OTk2LCJhdWQiOiJhdXRoL3JlZnJlc2gvOTZlMzE3YmQtOGNkYi00YWFiLTkwMzktNTZhZTY4M2QwMzBjIn0.oCM9aMjv0XySRKug00gLwUarMTrIXnQ8bs5GL8bJ29V8A_DKlqhRz9rLMQsUtBQk35rbAnL4wiww4k7BQLkT50fHZ5VKhdjCPKgN0c_RqflHnHhqiVpoT4vG9ZQKLMziJCZh6LkGu69HxXVlHO79shQnVyn9Vt0ljJFadb-7qP1J65o4XAI-pC3cc6MVqfhdIfMPtSkdGbtJU4ahXsG9qTIMY5Nll-0Y6aD6hinoQ_dFJLkhYknRfqYi_iBjEBntSGjcN-_kM65iWhVHKYCsjdCrfkyjzHYEDPR9386rU6vMV_KEjwbItV7D1Y4tar8D3Ae48rEi5LcHwgwlFSbZjA&grant_type=Refresh_token"

The server sends a response in the following format.

Response:

200

Response Body:

{

 "access_token": "eyJhbGciOiJSUzUxMiIsImtpZCI6IjcxMDhGMUZCMTIyODBBOEE5ODQzQzY1NTU5NjJFNDU5NTEzNUYyREMiLCJ0eXAiOiJKV1QifQ.eyJqdGkiOiI5NWFjYjM1Ni05ZDgzLTQzNzItYjc5Yy0zY2MwZjljZTYyZWMiLCJ1bmlxdWVfbmFtZSI6ImFsZW5hIiwicm9sZSI6IkFkbWluaXN0cmF0b3IiLCJuYmYiOjE2MDY5MDg5NjMsImV4cCI6MTYwNjkxMjU2MywiaWF0IjoxNjA2OTA4OTYzLCJhdWQiOiJhcGkvZGVmYXVsdC9mMTQ0NDYyNS1mMGIwLTQ5OTctOTEzOC01MDUzNmQ4YTE3NGIifQ.JTdat3T5eGhxC_3LblZPt7Td2DU9p6J7PGCO9RCZsVvXPBd1_U0lUBucfalqUiGskvzbB5F_tNpcwL3Bn6IuogFfpWtaGAW8Iw4vSh9GVIuWgQmk-gidVZfZvwDtu7t520FTAm9h3Be2aehvPvE9PsbbGYXHhqPH-Zhdy0oV4IKa2-ndxBlfXR_vdGc3BX0akBcl_AphP1dq4cQ7N4_8OVYGnTGGK9JbbNAfznnSEYycKESyo0trnGXRlQ_x4ZuIyH4ldXVLo18eBqfgTcF9a20rpTPoILeJ7_w1wcMvB_bCxxlWo9c8LCs6LgO5j8mwz1CzWAnTlsaGP0bE3DY2bA",

 "token_type": "bearer",

 "refresh_token": "eyJhbGciOiJSUzUxMiIsImtpZCI6IjcxMDhGMUZCMTIyODBBOEE5ODQzQzY1NTU5NjJFNDU5NTEzNUYyREMiLCJ0eXAiOiJKV1QifQ.eyJqdGkiOiI5NWFjYjM1Ni05ZDgzLTQzNzItYjc5Yy0zY2MwZjljZTYyZWMiLCJ1bmlxdWVfbmFtZSI6ImFsZW5hIiwicm9sZSI6IkFkbWluaXN0cmF0b3IiLCJuYmYiOjE2MDY5MDg5NjMsImV4cCI6MTYwODExODU2MywiaWF0IjoxNjA2OTA4OTYzLCJhdWQiOiJhdXRoL3JlZnJlc2gvYjVjYzJjZjItMjY2Ny00ZDRmLWE3OGItYzg1ZWZmMWM0ZDI1In0.FPwO5tWp9RaDQjWp2adMrRlvcGXNoLxhCWRDvorkjPEjhaxHiheh9N7B5GGVaTlLGegxnuWiG_DmyDQ2NTDTbVk5DV1e_cudsYeIA82nDOm9NafOucF6PSOcmA_gpvemR1en-tlkaP8m5kjVTCZaDHbXwtcsyqvFrQ1jXebUweCixaZ5NsNG8GvtOtGtwWlX9JaTBokR_XFAMwrgVKSGzoYhw_JxQnd_oPm0a9WZlDUmADoVtpX0AW0_vMKzR71I4robae3RbN1Eg_g9fCnCtKLEcD0B8D229X10mS49TLla6N-whHy2lt9WMuAs99gI9FJqPqOnBvYX2ao7mpHlWA",

 "expires_in": 3600,

 ".issued": "2020-12-02T11:36:03.3938883Z",

 ".expires": "2020-12-02T12:36:03.3897314Z",

 "username": "administrator",

 "roleName": "Administrator",

 "mfa_enabled": false

}

I want to report a typo

There is a misspelling right here:

 

I want to let the Veeam Documentation Team know about that.