2024-11-15 22:55:53 +01:00
|
|
|
@oauthBaseUrl = https://api.sparebank1.no/oauth
|
|
|
|
@bankingBaseUrl = https://api.sparebank1.no/personal/banking
|
|
|
|
|
|
|
|
### Authorize with Sparebank1
|
|
|
|
GET {{oauthBaseUrl}}/authorize?client_id={{sparebank1OauthClientId}}&
|
|
|
|
state={{sparebank1OauthState}}&
|
|
|
|
redirect_uri={{sparebank1OauthRedirectUri}}&
|
|
|
|
finInst=fid-smn&
|
|
|
|
response_type=code
|
|
|
|
|
|
|
|
### OAuth2 Access Token Request
|
|
|
|
# Refresh token is valid for 365 days
|
|
|
|
# Access token is valid for 10 minutes
|
|
|
|
POST {{oauthBaseUrl}}/token
|
|
|
|
Content-Type: application/x-www-form-urlencoded
|
|
|
|
|
|
|
|
client_id = {{sparebank1OauthClientId}} &
|
|
|
|
client_secret = {{sparebank1OauthClientSecret}} &
|
2025-01-22 21:00:04 +01:00
|
|
|
code = {{sparebank1OauthAuthCode}} &
|
2024-11-15 22:55:53 +01:00
|
|
|
grant_type = authorization_code &
|
|
|
|
state = {{sparebank1OauthState}} &
|
|
|
|
redirect_uri = {{sparebank1OauthRedirectUri}}
|
|
|
|
|
|
|
|
> {%
|
|
|
|
client.global.set("ACCESS_TOKEN", response.body.access_token)
|
|
|
|
client.global.set("REFRESH_TOKEN", response.body.refresh_token)
|
|
|
|
%}
|
|
|
|
|
|
|
|
### OAuth2 Access Token Refresh
|
|
|
|
|
|
|
|
POST {{oauthBaseUrl}}/token
|
|
|
|
Content-Type: application/x-www-form-urlencoded
|
|
|
|
|
|
|
|
client_id = {{sparebank1OauthClientId}} &
|
|
|
|
client_secret = {{sparebank1OauthClientSecret}} &
|
|
|
|
refresh_token = {{REFRESH_TOKEN}} &
|
|
|
|
grant_type = refresh_token
|
|
|
|
|
|
|
|
> {%
|
|
|
|
client.global.set("ACCESS_TOKEN", response.body.access_token)
|
|
|
|
client.global.set("REFRESH_TOKEN", response.body.refresh_token)
|
|
|
|
%}
|
|
|
|
|
|
|
|
### Hello World from Sparebank1
|
|
|
|
GET https://api.sparebank1.no/common/helloworld
|
|
|
|
Authorization: Bearer {{ACCESS_TOKEN}}
|
|
|
|
Accept: application/vnd.sparebank1.v1+json; charset=utf-8
|
|
|
|
|
|
|
|
### Fetch all accounts
|
|
|
|
GET {{bankingBaseUrl}}/accounts
|
|
|
|
Authorization: Bearer {{ACCESS_TOKEN}}
|
|
|
|
|
2025-01-22 21:00:04 +01:00
|
|
|
### Fetch all transactions of specific days (inclusive)
|
2025-02-02 12:37:43 +01:00
|
|
|
GET {{bankingBaseUrl}}/transactions?accountKey={{accountKey1}}&accountKey={{accountKey2}}&
|
|
|
|
fromDate=2025-01-20&
|
|
|
|
toDate=2025-01-24
|
2024-11-15 22:55:53 +01:00
|
|
|
Authorization: Bearer {{ACCESS_TOKEN}}
|
2025-01-22 21:00:04 +01:00
|
|
|
Accept: application/vnd.sparebank1.v1+json; charset=utf-8
|