Skip to main content

AIS request-response

Maxime avatar
Written by Maxime
Updated over 4 months ago

Krok 1: GET 10.13.133.40/api/country/PL/bank

pobranie listy banków dostępnych dla wskazanego api-clientId

cache-control: no-cache

accept-language: en-gb

api-clientid: pko

ip: 127.0.0.1

accept-encoding: gzip, deflate

response

HTTP/1.1 200

status: 200

transfer-encoding: chunked

content-type: application/json; charset=utf-8

server: Kestrel

x-powered-by: ASP.NET

date: Thu, 23 May 2019 09:45:25 GMT

{

"success":true,

"data":[

{

"swiftBicCode":null,

"logoUrlHash":null,

"country":

{

"languageCode":"pl",

"currencyCode":"PLN",

"dialCode":"+48",

"flagUrl":"/img/Country/Flag/flag-of-Poland.png",

"flagUrlHash":"B98788F08BD716E53325371F3B39439D63956E5B",

"fullName":"Poland",

"isoCode":"pl",

"alternativeISOCode":null

},

"id":75,

"name":"PKO",

"officialName":"PKO BP SA",

"logo":null,

"color":null,

"migrateToBankId":null,

"isPisp":null,

"isPisForceAccount":null,

"provider":{ },

"isAisForceAccount":true

]

}

Krok 2: POST 10.13.133.40/api/bank/75/authorize

uruchomienie sesji AIS

content-type: application/json

api-clientid: pko

accept-language: en-gb

ip: 127.0.0.1

accept-encoding: gzip, deflate

content-length: 167

{

"userId": "<USER ID>",

"months": 2,

"values":

[

],

"externalconsentid": string,

"externalconsentguid": string,

"purpose":

[

{

"key": "string"

}

]

}

final naming of the attributes (externalconsentid, externalconsentguid, purpose) will be confirmed in RN for version 3.2 (101)

response

HTTP/1.1 202

status: 202

transfer-encoding: chunked

content-type: application/json; charset=utf-8

server: Kestrel

x-powered-by: ASP.NET

date: Thu, 23 May 2019 09:48:52 GMT

success : true

data

url : "http://10.13.206.92:8090/authorizationForm?bankId=1&amp;stateToken=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdGF0ZVRva2VuIjoie1wi Y2xpZW50SWRcIjpcImV5SjBlWEFpT2lKS1YxUWlMQ0poYkdjaU9pSklVekkxTmlKOS5leUp5 WldScGNtVmp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cIjo1MH0sXCJhaXM6Z2V0VHJhbnNhY3Rpb25zUmVqZWN0ZWRcIjp7XCJzY29w ZVVzYWdlTGltaXRcIjpcIm11bHRpcGxlXCIsXCJtYXhBbGxvd2VkSGlzdG9yeUxvbmdcIjo1MH 0sXCJhaXM6Z2V0VHJhbnNhY3Rpb25zQ2FuY2VsbGVkXCI6e1wic2NvcGVVc2FnZUxpbWl0 XCI6XCJtdWx0aXBsZVwiLFwibWF4QWxsb3dlZEhpc3RvcnlMb25nXCI6NTB9LFwiYWlzOmd ldFRyYW5zYWN0aW9uc1NjaGVkdWxlZFwiOntcInNjb3BlVXNhZ2VMaW1pdFwiOlwibXVsd GlwbGVcIixcIm1heEFsbG93ZWRIaXN0b3J5TG9uZ1wiOjUwfSxcImFpczpnZXRUcmFuc2FjdGl vbkRldGFpbFwiOntcInNjb3BlVXNhZ2VMaW1pdFwiOlwibXVsdGlwbGVcIn19LFwiZWRpdGFi bGVcIjpmYWxzZSxcInJlcGxpY2FibGVcIjpmYWxzZSxcImRlbGV0YWJsZVwiOmZhbHNlfV0s XCJzdGF0ZVwiOlwiU1RBVEUxMjM0NTZcIixcImJhbmtJZFwiOlwiMVwiLFwiaXNDb3Jwb3Jh dGVcIjpmYWxzZX0ifQ.bCvSflYVEVEgF4Cy- 14wQm5zZ_gdjutOPp3eKazTm6k "

sessionId : "<SESSION ID>"

Krok 3: POST 10.13.133.40/api/bank/75/authorize

Przekazanie otrzymanego code

content-type: application/json

api-clientid: pko

accept-language: en-gb

ip: 127.0.0.1

accept-encoding: gzip, deflate

content-length: 2136

{

"userId": "<USER ID>",

"months": 2,

"sessionId": "<SESSION ID>",

"values": [

{

"key": "Consent",

"value": "<OAUTH CODE> "

}

]

}

UWAGA: w wersji 3.20 (101) następuje zmiana pola consent na code.

response

HTTP/1.1 200

status: 200

transfer-encoding: chunked

content-type: application/json; charset=utf-8

{

"success": true,

"data": null

}

Krok 4a: GET 10.13.133.40/api/bank/session/<SESSION ID>

Polling statusu sesji

api-clientid: pko

accept-language: en-gb

ip: 127.0.0.1

accept-encoding: gzip, deflate

response

HTTP/1.1 200

status: 200

transfer-encoding: chunked

content-type: application/json; charset=utf-8

server: Kestrel

x-powered-by: ASP.NET

date: Thu, 23 May 2019 09:52:36 GMT

{

"success": true,

"data": {

"sessionStatus": "completed",

"bankAccounts": [{

"id": 88,

"accountName": "GERALD KULA",

"iban": " PL61 0001 2345 0000 0000 0904 0575 ","

bank ":{"

swiftBicCode ":null,"

logoUrlHash ":null,"

country ": {

"languageCode": null,

"currencyCode": null,

"dialCode": "+48",

"flagUrl": "/img/Country/Flag/flag-of-Poland.png ","

flagUrlHash ":"B98788F08BD716E53325371F3B39439D63956E5B ","

fullName ":"Poland ","

isoCode ":"pl ","

alternativeISOCode ":null},"

id ":75,"

name ":"PKO ","

officialName ":"PKO BP SA ","

logo ":null,"

color ":null,"

migrateToBankId ":null,"

isPisp ":null,"

isPisForceAccount ":null,"

provider ": {

"providerId": 37,

"provider": "PolishApiConnector",

"providerType": "api",

"dynamicDataPath": null,

"

dynamicDataRegex ":null},"

isAisForceAccount ":true},"

balance ":11366.73,"

currencyCode ":"PLN ","

lastSyncDate ":"

2019 - 05 -23 T09: 48: 52.427723 ","

consentStatus ":"active ","

syncStatus ":"failed ","

lastTransactionDate ":null,"

isActive ":true,"

isBusiness ":false,"

retrievedName ":null,"

providerType ":null,"

generateNotifications ":false,

"syncOffline": true,

"importDate": "2019-05-20 T09: 02: 21.3878973 ","

balanceOverdraft ":0.00,"

userName ":"GERALD KULA ul.Zaolziańska 3793 - 535 Łódź Polska ","

errorMessage ":null,"

lastSessionStatus ":"completed ","

secondaryIdentifiers ": [],

"hasImage": false

}]

Krok 4b: callback z informacją o statusie konta i pobranych rachunkach

Sesja w trakcie

}

}

{

„sessionid”: „<sessionId>",

„tpptoken”: „<token provided by TPP when initialising AIS session e2-e identifier>”,

„sessionid”: „<sessionId>",

„userid”: „<userId>",

„bankid”: „<bankId>",

"stage": „accounts”,

"status": "inProgress",

"accountsFetchedCount": 2,

"accountsProcessedCount": 0

}

Callback po otrzymaniu listy rachunków

{

„sessionid”: „<sessionId>",

„tpptoken”: „<token provided by TPP when initialising AIS session e2-e identifier>”,

„userid”: „<userId>",

„bankid”: „<bankId>",

"stage": „accounts”,

"status": "inProgress",

"details":{

"accounts": [

{

accountNumber: "BE2345",

accountType: "",

accountRelation: ""

},{

accountNumber: "ABSDFGZh"

}]

}

}

Krok 5: GET 10.13.133.40/api/bankaccount?userId=<USER ID>

Pobranie rachunków dla wskazanego usera

cache-control: no-cache

postman-token: 6373989b-aeb0-4c9b-b1f1-940b290aaedb

api-clientid: pko

accept-language: en-gb

ip: 127.0.0.1

user-agent: PostmanRuntime/6.4.1

accept: */*

host: 10.13.133.40

accept-encoding: gzip, deflate

response

HTTP/1.1 200

status: 200

transfer-encoding: chunked

content-type: application/json; charset=utf-8

server: Kestrel

x-powered-by: ASP.NET

date: Thu, 23 May 2019 09:52:48 GMT

{

"success": true,

"data": [{

"id": 88,

"accountName": "GERALD KULA",

"iban": " PL61 0001 2345 0000 0000 0904 0575 ","

bank ": {

"swiftBicCode": null,

"logoUrlHash": null,

"country": null,

"id": 75,

"name": "PKO",

"officialName": "PKO BP SA ",

"logo" ":null,"

"color" ":null,"

"migrateToBankId" ":null,

"isPisp" ":null,"

"isPisForceAccount" ":null,

"provider" ": {

"providerId": 37,

"provider": "PolishApiConnector",

"providerType": "api",

"dynamicDataPath": null,"

dynamicDataRegex ":null},"

isAisForceAccount ":true},"

balance ":11366.73,"

currencyCode ":"PLN ","

lastSyncDate ":"2019 - 05 -23 T09: 48: 52.427723 ","

consentStatus ":"active ","

syncStatus ":"failed ","

lastTransactionDate ":"2017 -10 -18 T12: 25: 05.0588075 ","

isActive ":true,"

isBusiness ":false,"

retrievedName ":null,"

providerType ":"api ","

generateNotifications ":false,"

syncOffline ":true,"

importDate ":"2019 - 05 -20 T09: 02: 21.3878973 ","

balanceOverdraft ":0.00,"

userName ":"GERALD KULA ul.Zaolziańska 3793 - 535 Łódź Polska ","

errorMessage ":null,"

lastSessionStatus ":"completed ","

secondaryIdentifiers ": [],

"hasImage": false

}]

}

request

GET

GET 10.13.133.40/api/transaction/?userID=<USER ID>?&pagenumber=1&pagesize=100&accountid=<ACCOUNT ID>

Pobranie transackji dla wskazanego rachunku

GET /api/transaction/

api-clientid: pko

accept-language: en-gb

ip: 127.0.0.1

accept-encoding: gzip, deflate

response

HTTP/1.1 200

status: 200

transfer-encoding: chunked

content-type: application/json; charset=utf-8

{

"success": true,

"data": {

"items": [{

"id": 2398,

"title": "Przelew 2",

"sender": "Jan Kowalski ",

"senderAddress ":"Hoża 29 / 31, Warsaw ",

"senderAccount ":"58 2490 0005 9716 38419028 2283 ",

"recipient ":"Krzysztof Wójcik ",

"recipientAddress ":"Wołoska 12,Warsaw ",

"recipientAccount ":"93 1020 0003 0700 2943 89447052 ",

"operationAmount ":1000.00,

"operationCurrencyCode ":"EUR ",

"bankName ":"PKOBP ",

"bankBranch ":"Warsaw ",

"accountingDate ":"2017 - 10 -18 T12: 25: 05.0588075 ",

"referenceNumber ":"17010203 - 0406 ",

"tags ":[]}, {

"id": 2397,

"title": "Przelew",

"sender": "Jan Kowalski",

"senderAddress": "Hoża 29/31,Warsaw ",

"senderAccount ":"58 2490 0005 9716 3841 9028 2283 ",

"recipient ":"AdamNowak ",

"recipientAddress ":"Marszałkowska 27 / 35,Warsaw ",

"recipientAccount ":"46 1020 00035953 6762 97443531 ",

"operationAmount ":2000.00,

"operationCurrencyCode ":"EUR ",

"bankName ":"PKOBP ",

"bankBranch ":"Warsaw ",

"accountingDate ":"2017 - 10 -18 T11: 24: 05.0588075 ",

"referenceNumber ":"17010203 - 0405 ",

"tags ": []

}], "totalItemsCount": 2, "pageNumber": 1, "pageSize": 100, "totalPagesCount": 1

}

}

Did this answer your question?