Now that you have your access token, follow the steps below to invoke the AccountsInformationAPI and obtain the account information:
Navigate to the WSO2 Open Banking live demo and click
AccountsInformationAPI
API.Note Make sure you are signed in to the WSO2 Open Banking live demo.
- Select the application you used to subscribe to the
AccountsInformationAPI
API from the Try dropdown. The previously generated access token appears by default. - CilckPOST /account-initiation to expand the
POST /account-initiation
API resource.- Enter the application access token you generated in Step 4 to the Authorization : Bearer field.
- Enter the sample values given in the UI to
body
,x-jws-signature
,x-fapi-interaction-id
, andx-fapi-financial-id
fields. Click Try it out. You receive a 201 response upon successful API invocation.
Tip Copy the
AccountRequestId
that is returned from above API call so that you can use it for the other API invocations.
Anchor | ||||
---|---|---|---|---|
|
Follow the steps below to generate a user access token:
CopytheURL Copy the URL shown below and update the placeholders as follows:
- Replace the
<client-ID>
with theconsumer key
that you generated in Step 4, e.g., fAIwK4n9QKKHIoGOv1DF6eUOkiMa. Replace the
<redirect-URL>
with theCallback URL
that you entered when generating the keys in Step 4, e.g., https://openbanking.wso2.com/authenticationendpoint/authorize_callback.do.Format:
Code Block https://api-openbanking.wso2.com/AuthorizeAPI/v1.0.0/?response_type=code&scope=accounts&state=YWlzcDozMTQ2&client_id=<client-ID>&redirect_uri=<redirect-URL>
Example:
Code Block https://api-openbanking.wso2.com/AuthorizeAPI/v1.0.0/?response_type=code&scope=accounts&state=YWlzcDozMTQ2&client_id=fAIwK4n9QKKHIoGOv1DF6eUOkiMa&redirect_uri=https://openbanking.wso2.com/authenticationendpoint/authorize_callback.do
- Replace the
- Paste the updated
URL
in your browser to navigate to the ABC Bank's open banking system. - When prompted, sign in using your wso2.com credentials.
This is the first factor of Strong Customer Authentication (SCA).
- Enter the verification code that you received via SMS to the mobile number that you gave at the time of signing up to wso2.com.
This serves as the second factor of SCA.
After the authentication process is complete, you are directed to the customer consent approval process. Click Approve to allow sharing of customer data.
After the consent process is approved, the authorization code appears.
Copy the cURL command shown below and update the placeholders as follows:
<client-ID>:<client-secret>
: Replace the<client-ID>
and the<client-secret>
with theconsumer key
and theconsumer secret
you generated in Step 4 respectively. Make sure to keep the colon (:) separator between them.<client-ID>
: Again, replace the<client-ID>
with theconsumer key
.<authorization-code>
: Replace this with theauthorization code
, e.g., 2b602c70-6a6e-3e96-9132-8570aaad4458.<redirect-URL>
: Replace this with theCallback URL
that you used to generate the keys, e.g.,https://openbanking.wso2.com/authenticationendpoint/authorize_callback.do
.Note You can only use the authorization code once.
Format:
Code Block curl -v -X POST --basic -u <client-ID>:<client-secret> -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" -k -d "client_id=<client-ID>&grant_type=authorization_code&code=<authorization-code>&redirect_uri=<redirect-URL>" https://api-openbanking.wso2.com/token/
Example:
Code Block curl -v -X POST --basic -u fAIwK4n9QKKHIoGOv1DF6eUOkiMa:2Ui34DIx7LfIiXtrUCCpkoUqKDUa -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" -k -d "client_id=fAIwK4n9QKKHIoGOv1DF6eUOkiMa&grant_type=authorization_code&code=ff105634-e437-3567-955d-0bcaee3603d8&redirect_uri=https://openbanking.wso2.com/authenticationendpoint/authorize_callback.do" https://api-openbanking.wso2.com/token/
Paste the updated cURL command in the command prompt to generate the user access token with the consented privileges.
Example:
Code Block > POST /token/ HTTP/1.1 > Host: api-openbanking.wso2.com > Authorization: Basic ZkFJd0s0bjlRS0tISW9HT3YxREY2ZVVPa2lNYToyVWkzNERJeDdMZklpWHRyVUNDcGtvVXFLRFVh > User-Agent: curl/7.51.0 > Accept: */* > Content-Type: application/x-www-form-urlencoded;charset=UTF-8 > Content-Length: 197 < HTTP/1.1 200 OK < Server: nginx/1.12.1 < Date: Fri, 15 Sep 2017 05:30:23 GMT < Content-Type: application/json < Transfer-Encoding: chunked < Connection: keep-alive < X-Frame-Options: DENY < Cache-Control: no-store < Access-Control-Allow-Origin: * < Access-Control-Allow-Methods: POST < X-Content-Type-Options: nosniff < Pragma: no-cache < X-XSS-Protection: 1; mode=block < Access-Control-Allow-Headers: authorization,Access-Control-Allow-Origin,Content-Type,SOAPAction < {"access_token":"c2f32c1e-37eb-3d86-8c48-f96cc200d16e","refresh_token":"9e38e258-385d-3bfc-82f6-b5ada4007589","scope":"payments","token_type":"
Now, try out other API resources with the generated user access token.
Info active true id ac-info-apis APIs used by users When accessing the following API resources, use the user access token you generated. GET /accounts/{AccountId}/beneficiaries
GET /accounts/{AccountId}/direct-debits
GET /accounts/{AccountId}/standing-orders
GET /accounts/{AccountId}/balances
GET /accounts/{AccountId}/product
GET /accounts/{AccountId}/transactions
GET /accounts
GET /accounts/{AccountId}
APIs used by applications
When accessing the following API resources, use the access token you generated using the
Client Credentials
grant type andaccounts : accounts
scope in Step 4.POST /account-initiations
DELETE /account-initiations/{AccountRequestId}
GET /account-initiations/{AccountRequestId}