Refresh Token
This API is used to extend an existing session validity in the security management application. If the provided token is valid, the security management application creates a new token with an extended validity.
| HTTP URL | |
|---|---|
| PUT | /api/v2/auth/token |
Eligibility
The Requester can request a refresh token for his own access token.
API Request
Request Structure
| Parameter | Type | M/O/CM | Description |
|---|---|---|---|
| token | String | M | Existing valid access token as was received from the security management application |
| refreshToken | String | M | Refresh token that was provided in the Create Token API response. |
API Response
Response Structure
| Parameter | Type | M/O/CM | Description |
|---|---|---|---|
| errorCode | String | O | Failure code. |
| errorMessage | String | O | Failure message. |
| content | Object | O | Array of main response body object displayed when an API call was successful. For a failure, it will be empty. |
| pageable | Object | O | Paging information object displayed when an API call was successful. For a failure, it will be empty. |
Content data objects
| Element | Type | M/O/CM | Description |
|---|---|---|---|
| token | String | M | New access token refreshed by the security management application |
| refreshToken | String | M | New refresh token created by the security management application for token session extension purposes |
| validityTime | Numeric | M | Token validity time in seconds |
Pageable data objects
| Element | Type | M/O/CM | Description |
|---|---|---|---|
| page | Numeric | M | Page number |
| size | Numeric | M | Page size. Number of requested elements per page |
| totalPages | Numeric | M | Total amount of available pages per requested page size |
| totalElements | Numeric | M | Total amount of retrieved elements |
Error Codes
In addition to the general success and failure codes, the following error codes are possible.
| Code | Message |
|---|---|
| AUTH_1002 | Invalid token |
Examples
Request Body
Copy
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjE1NSwiZW1haWwiOiJzaGF1bC5jb2hlbkBmb...",
"refreshToken":
"eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI4NzlmN2I0Yy1hZjU3LTQ4Y2ItYTc2Mi1kY2Ew..."
}
Response Body: Success ACK
Copy
{
"errorCode": "",
"errorMessage": "",
"content": [
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjE1NSwiZW1haWwiOiJzaGF1bC5jb2hlbkBmb...",
"refreshToken":
"eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI4NzlmN2I0Yy1hZjU3LTQ4Y2ItYTc2Mi1kY2Ew...",
"validityTime": 3600
}
],
"pageable": {
"page": 0,
"size": 10,
"totalPages": 1,
"totalElements": 1
}
}
Response Body: Failure NAK
Copy
{
"errorCode": "AUTH_1002",
"errorMessage": "Invalid token"
"content": "",
"pageable": ""
}