This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Deploying APIs for Australia
This document guides you with the assumption that you have set up the WSO2 Open Banking Identity and Access Management and API Management modules on separate servers.
Updating the CDS Swagger file
If you are deploying the Consumer Data Standards API v1.3.0 API, do the following updates before you publish the API:
- Open the
<WSO2_OB_APIM_HOME>/repository/resources/finance/apis/consumerdatastandards.org.au/1.3.0/consumer-data-standards-1.3.0.yaml
Swagger file in a text editor. - To validate the
x-fapi-auth-date
for a validHTTP-date
:- Locate all the
- name: x-fapi-auth-date
occurrences. Under each of these occurrences, add the following attribute:
pattern: '^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), \d{2} (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} \d{2}:\d{2}:\d{2} (GMT|UTC)$'
- Locate all the
- To accept null or a JSON object as the
Meta
attribute in the POST request body:- Locate the
Meta
attribute definition Add the following
x-nullable
andadditionalProperties
tags under the Meta attribute:Meta: type: object x-nullable: true additionalProperties: {}
- Locate the
To validate the
newest-time
and theoldest-time
query parameters passed in the GET Transactions for Account requests:- Locate all the
- name: oldest-time
and- name: newest-time
occurrences. Add the
format: date-time
tag under each occurrence as follows:- name: newest-time in: query description: Constrain the transaction history request to transactions with effective time at or before this date/time. If absent defaults to today. Format is aligned to DateTimeString common type required: false type: string format: date-time x-cds-type: DateTimeString
- Locate all the
To enforce
page
andpage-size
query parameter validations.This is available only as a WUM update and is effective from April 20, 2021 (04-20-2021). For more information on updating WSO2 Open Banking, see Updating WSO2 Products .
- To validate
min-amoun
t andmax-amount
forAmountString:
- Locate the
min-amount
andmax-amount
tags Add the following attribute under each tag:
pattern: '^\-?\d{1,16}\.\d{2,}$'
For example:
name: min-amount in: query description: Filter transactions to only transactions with amounts higher or equal to than this amount required: false type: string pattern: '^-?\d{1,16}.\d{2,}$' x-cds-type: AmountString name: max-amount in: query description: Filter transactions to only transactions with amounts less than or equal to than this amount required: false type: string pattern: '^-?\d{1,16}.\d{2,}$' x-cds-type: AmountString
- Locate the
- Save the changes and publish the updated Swagger file.
Configuring the velocity_template.xml
- Open the
<WSO2_OB_APIM_HOME>/repository/resources/api_templates/velocity_template.xml
file. - Update the
<
IAM_HOSTNAME>
placeholder with the hostname of your Identity and Access Management server.
Configuring synapse files
Add the following synapse configurations to retrieve infosec statistics via the Consumer Data Standards Administration API.
This is available only as a WSO2 Update and is effective from July 09, 2021 (07-09-2021). For more information on updating WSO2 Open Banking, see Updating WSO2 Products.
- Go to the
<WSO2_OB_APIM_HOME>/repository/deployment/server/synapse-configs/default/api/
directory. - Open the following files and update them by adding the given property and handlers:
_TokenAPI_.xml
_RevokeAPI_.xml
_AuthorizeAPI_.xml
Add the following property just under the
<inSequence>
tag:<property name="api.ut.backendRequestTime" expression="get-property('SYSTEM_TIME')"/>
Add the following two handlers just under the
<handlers>
tag:<handler class="org.wso2.carbon.apimgt.gateway.handlers.common.APIMgtLatencyStatsHandler"/> <handler class="com.wso2.finance.open.banking.management.information.reporting.data.publisher.ReportingDataHandler"/>
Step 5 and step 6 are available only as a WUM update and are effective from June 30, 2019 (06-30-2021). For more information on updating WSO2 Open Banking, see Updating WSO2 Products .
- Copy the
<WSO2_OB_APIM_HOME>/repository/resources/finance/sequences/AU/_token_error_mediator_.xml
file to the<WSO2_OB_APIM_HOME>/repository/deployment/server/synapse-configs/default/sequences
directory. Modify the
<WSO2_OB_APIM_HOME>/repository/deployment/server/synapse-configs/default/api/_TokenAPI_.xml
file by adding the<sequence key="_token_error_mediator_"/>
tag as follows:<api xmlns="http://ws.apache.org/ns/synapse" name="_WSO2AMTokenAPI_" context="/token"> <resource methods="POST" url-mapping="/*" faultSequence="_token_fault_"> <inSequence> <property name="uri.var.portnum" expression="get-property('keyManager.port')"/> <property name="uri.var.hostname" expression="get-property('keyManager.hostname')"/> <send> <endpoint> <http uri-template="https://{uri.var.hostname}:{uri.var.portnum}/oauth2/token"> <timeout> <duration>60000</duration> <responseAction>fault</responseAction> </timeout> </http> </endpoint> </send> </inSequence> <outSequence> <sequence key="_token_error_mediator_"/> <send/> </outSequence> </resource> <handlers>
Create and publish an API
In WSO2 Open Banking you can configure the following APIs:
- Consumer Data Standards API v1.3
- Consumer Data Standards Administration API v1.2.0
- CDR Arrangement Management API v1.0.0
- Dynamic Client Registration API v0.1
Follow the steps given below to create and publish an API.
Make sure the following handler is available the under the
<handlers>
tag in the<WSO2_OB_APIM_HOME>/repository/deployment/server/synapse-configs/default/api/_TokenAPI_.xml
file.<handler class="com.wso2.finance.open.banking.mtls.validator.handler.GatewayClientAuthenticationHandler"/>
If it's not available, add the handler and restart the server with the WSO2 Open Banking API Management module.
- Create a user with Internal/creator and Internal/publisher roles in order to configure the API. For more information on creating a user, see Configuring users and roles.
- If an API is already deployed with a previous version, you may create a new version of it instead of deploying a new API. For more information, see Create a new version for an existing API.
You can configure APIs through the API Publisher by signing in as a user whose role includes
Internal/publisher
. Follow the steps given below
Sign in to the API Publisher Portal (
https://<WSO2_OB_APIM_HOST>:9443/publisher
).In the APIs tab, select CREATE NEW API > I Have an Existing REST API.
- Set the Input Type to OpenAPI File.
- Click BROWSE FILE TO UPLOAD and select the Swagger definition (.yaml file) from the
<WSO2_OB_APIM_HOME>/repository/resources/finance/apis/consumerdatastandards.org.au/
directory based on your specification and version of the API. - Click Next.
Set the endpoint according to your API.
Following services are available in the solution, update the
<WSO2_OB_APIM_HOST>
placeholder with the hostname of your API Manager server.API Endpoint Consumer Data Standards API https://<WSO2_OB_APIM_HOST>:9443/api/openbanking/backend-cds/services
Consumer Data Standards Administration API https://<WSO2_OB_APIM_HOST>:9443/api/openbanking/cds-admin-api/au100
Dynamic Client Registration API https://<WSO2_OB_APIM_HOST>:9443/api/openbanking/dynamic-client-registration/common
CDR Arrangement Management API https:
//<WSO2_OB_IAM_HOST>:9446/cdr-arrangement-management/arrangements
- Set the business plan to Unlimited : Allows unlimited requests unless you want to limit the requests.
- Click Create to create the API.
- Once you get the message that the API is successfully updated, go to Runtime Configurations using the left menu panel.
- Click the edit button under Request > Message Mediation.
- Now, select the Custom Policy option.
- Upload the relevant in-sequence file and click SELECT. For more details, see the table below.
- Scroll down and click SAVE.
- Now, go to Properties using the left menu panel.
- Click Add New Property.
Add the API Properties according to your API and click the Add button.
For example:API Property Name
Property Value Consumer Data Standards API v1.3 ob-spec
au ob-api-type
account
Consumer Data Standards Administration API v1.2.0 ob-spec au
ob-api-type
cds-admin
Dynamic Client Registration API v0.1 ob-spec
au
ob-api-type
dcr
CDR Arrangement Management API v1.0.0 ob-spec
au
ob-api-type
cdr-arrangement
For more details, see the table below.- Click SAVE.
- Go back to Overview using the left menu panel.
- Click PUBLISH.
- The published API is available in the Developer Portal at
https://<WSO2_OB_APIM_HOST>:9443/devportal
.
Summarized information for configuring APIs
API | Swagger definition (yaml file) | Endpoint (Sandbox/Production) | Message mediation (sequence file) | API property name | API property value |
---|---|---|---|---|---|
Consumer Data Standards API v1.3 |
| HTTP/REST Endpoint
| <WSO2_OB_APIM_HOME>/repository/resources/finance/apis/consumerdatastandards.org.au/1.3.0/cds-dynamic-endpoint-insequence-1.2.0.xml | ob-spec |
au
|
ob-api-type | account | ||||
Consumer Data Standards Administration API v1.2.0 | <WSO2_OB_APIM_HOME>/repository/resources/finance/apis/consumerdatastandards.org.au/CDSAdminAPIs/1.2.0/cds-admin-1.2.0.yaml
| HTTP/REST Endpoint
| <WSO2_OB_APIM_HOME>/repository/resources/finance/apis/consumerdatastandards.org.au/CDSAdminAPIs/1.2.0/cds-admin-endpoint-insequence-1.2.0.xml | ob-spec |
au
|
ob-api-type | cds-admin | ||||
Dynamic Client Registration API v0.1 | <WSO2_OB_APIM_HOME>/repository/resources/finance/apis/consumerdatastandards.org.au/DynamicClientRegistration/0.1/ au-dcr-swagger.yaml | HTTP/REST Endpoint
| <WSO2_OB_APIM_HOME>/repository/resources/finance/apis/consumerdatastandards.org.au/DynamicClientRegistration/0.1
/au-dcr-insequence-0.1.xml | ob-spec | au |
ob-api-type | dcr | ||||
CDR Arrangement Management API v1.0.0 |
<WSO2_OB_APIM_HOME>/repository/resources/finance/apis/consumerdatastandards.org.au/CDRArrangement/cdr-arrangement-mgt-api.yaml
| HTTP/REST Endpoint
| N/A | ob-spec | au |
ob-api-type | cdr-arrangement |
Enable endpoint versioning
Once the selected support version is validated, it is updated in the x-v
header parameter in the request. Therefore, when directing the request to the relevant back end API, you can obtain the version from the x-v
header value.
When publishing the swagger, the Data Holder should edit each endpoint and include the supported endpoint versions in the x-version
parameter as comma-separated values. For example:
x-version: "1,2"
If you modify the Swagger after publishing the API, you need to republish the API to apply the changes.
Enable Data Holder specific versioning
To define a Data Holder specific identifier for extended API endpoints, configure the following. For example, if the Data Holder is ABC-Bank.
[open_banking.au] holder_identifier = "ABC-Bank"
Create a new version for an existing API
In the API Publisher of WSO2 Open Banking, users are not allowed to duplicate the scope of an API. Therefore, users are allowed to create a new version of the API in order to share the same scope.
Sign in to the API Publisher at
https://<WSO2_OB_APIM_HOST>:9443/publisher
.- Navigate to the API listing page, and select the API for which you want to create a new version.
Click Create New Version.
Enter a version number and click Create.
You are redirected to the API Overview page.
- Go to API Definition using the left menu panel.
- Click IMPORT DEFINITION.
Set the Input Type to OpenAPI File.
Click BROWSE FILE TO UPLOAD and select the Swagger definition (.yaml file) according to your API.
Click Import. The changes are auto-saved.
- Go to Runtime Configurations using the left menu panel.
- Click the edit button under Request > Message Mediation.
- Now, select the Custom Policy option.
- Upload the relevant in-sequence file and click SELECT.
- Scroll down and click SAVE.
Go to Lifecycle using the left menu panel.
- Check Deprecate old versions after publishing the API checkbox, if you want to deprecate previous versions.
Check Requires re-subscription when publishing the API checkbox, only if you want to remove the subscriptions from the previous version.
Leave the Requires Re-Subscription when publishing the API checkbox cleared if you want all users who are subscribed to the older version of the API to be automatically subscribed to the new version. If not, they need to subscribe to the new version again.
- Click Publish .
Request payload validation
Request payload validation adds flexibility to validate an incoming request against any customisations done to the swagger definition.
For example, the x-v
header in the CDS Banking API is a mandatory header and the solution will validate the incoming request against the published swagger. If the x-v
header is not available in the requests the solution will give an error response.
When an API is published, the swagger file is added as a local entry and saved under the <WSO2_OB_APIM_HOME>/repository/deployment/server/synapse-configs/default/local-entries
directory.
To add the swagger as a local entry, the created and published API lifecycles are extended using customised API executor named com.wso2.finance.open.banking.api.executor.OBAPIPublisherExecutor
. For more information on executors, see Extension Points of API Life cycle.
When you modify Swagger the solution will validate the incoming request against the updated Swagger file. If you modify the Swagger after publishing the API, republish the API to apply the swagger based validations. Therefore, follow the steps below:
Configuring error responses according to CDS
Follow the instructions below to modify the sequence files and update the error responses of the Accounts API according to the CDS specification.
This is available only as a WSO2 Update and is effective from July 14, 2021 (07-14-2021). For more information on updating WSO2 Open Banking, see Updating WSO2 Products.
- Go to the
<WSO2_OB_APIM_HOME>/repository/resources/finance/sequences/AU
directory and locate the following files:fault_error_mediator.xml
main_error_mediator.xml
common_error_mediator.xml
- Copy the above files to the
<WSO2_OB_APIM_HOME>/repository/deployment/server/synapse-configs/default/sequences
directory. - Open the
<WSO2_OB_APIM_HOME>/repository/deployment/server/synapse-configs/default/sequences/fault.xml
file in a text editor.Find the
<sequence key="_cors_request_handler_"/>
tag and add the following property and sequence configurations:<property name="last_error_mediator" value="fault"/> <sequence key="_cors_request_handler_"/> <sequence key="_fault_error_mediator_"/>
- Save the changes.
- Open the
<WSO2_OB_APIM_HOME>/repository/deployment/server/synapse-configs/default/sequences/main.xml
file in a text editor.Find the
<send/>
tag and add the following sequence configuration:<sequence key="_main_error_mediator_"/> <send/>
- Save the changes.
- Open the
<WSO2_OB_APIM_HOME>/repository/deployment/server/synapse-configs/default/sequences/_cors_request_handler_.xml
file in a text editor.Find the
</sequence>
tag and add the following sequence configuration:<sequence key="_common_error_mediator_"/> </sequence>
- Save the changes.
- Restart the API Manager server.