Refresh an expired bearer token
In case you get an unauthorized response from a protected endpoint with the code expired_token (or if you just feel like it), you can try to refresh the bearer token using the corresponding longer lived refresh token. A new bearer token and a new refresh token is received, both with prolonged expiration. The refresh token used in the request is now invalidated, and the one received here must be used for future refreshes. Note that the old bearer token might still be valid though.
Request
- Base URL: https://bankapidemo.svea.com
- URL: https://bankapidemo.svea.com/auth/refresh
- Auth: none declared
Headers
The correlationId is a unique identifier value that is attached to requests and messages that allow reference to a particular transaction or event chain. Used to follow transaction information, especially for logging purposes.
The sessionId is a unique identifier value for a users session. This identifier should be the same for the entire duration of that users session. Mainly used for logging and troubleshooting purposes.
Request body
Example request
{
"refreshToken": "3693fd591a812118607ab7c7cedf1b3697dd37241923a440772facb66197b131"
}Response
OK
Example response
{
"bankIdUser": {
"bankIdNumber": "199403086854",
"correspondenceName": "Testy McTestface",
"firstName": "Testy",
"lastName": "McTestface"
},
"bearerToken": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjA2RThEQTgwMDQ...",
"psus": [
{
"accessLevel": "restrictedLevel",
"actionRequired": [
{
"action": "kyc",
"validUntil": "2020-12-24"
}
],
"capabilities": [
"sendPaymentOrders"
],
"capabilitiesContext": [
{
"accessType": "accountAccess",
"accountAccessLevel": "read",
"bankAccountId": "ccf7c77a-8e32-4d9b-8f40-ea446f37d492"
}
],
"delegateId": "7aa2dfea-2b0c-45cb-8f03-4743c284417d",
"psuContext": {
"correspondenceName": "Testy McTestface",
"personKey": "199403086854"
},
"psuId": "febbe8f2-bd6b-4e53-89c6-e89ca92ff5ee",
"psuType": "person"
}
],
"refreshToken": "27a5dc2d363357ab4f32ff5..."
}Changes
No recorded changes to this operation across all 1 revision of this API.