Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: mireport api

...

Table of Content Zone
locationtop

Enabling Data Reporting

Follow the steps below to enable Data Reporting. 

  1. Open  <WSO2_OB_APIM_HOME>/repository/conf/finance/open-banking.xml and  <WSO2_OB_KM_HOME>/repository/conf/finance/open-banking.xml  files.
  2. Under the <DataPublishing> sub-element set the <Enabled> parameter to true to enable the feature. 
  3. Replace the <WSO2_OB_BI_HOST> placeholder with the hostname of your WSO2 OB BI server and configure the other parameters accordingly.  
Code Block
languagexml
<BIServer>
   <DataPublishing>
      <!-- Include all configurations related to Data publishing -->
      <!-- Enable data publishing in WSO2 Open Banking-->
      <Enabled>true</Enabled>
      <!-- Server URL of the remote BI server used to collect statistics. Must
            be specified in protocol://hostname:port/ format. -->
      <ServerURL>{tcp://<WSO2_OB_BI_HOST>:7612}</ServerURL>
      <!-- Administrator username to login to the BI server for data publishing. -->
      <Username>admin@wso2.com@carbon.super</Username>
      <!-- Administrator password to login to the BI server for data publishing. -->
      <Password>wso2123</Password>
   </DataPublishing>
</BIServer>



Configuring Open Banking Business Intelligence

  1. Configuring databases

    The following databases store raw and summarized data. Make sure they are available in your database servers.

    • openbank_ob_reporting_statsdb

    • openbank_ob_reporting_summarizeddb

  2. Configuring datasources
    • Modify the OB_REPORTING_DB and OB_REPORTING_SUMMARIZED_DB datasources in <WSO2_OB_BI_HOME>/conf/worker/deployment.yaml file.
    • Update  jdbcUrl username password  and  driverClassName  in the datasource entries with your database configurations. A sample is given below:
    Code Block
    languagexml
    - name: OB_REPORTING_DB
      description: The datasource used to store statistics for OB Reporting module
      jndiConfig:
        name: jdbc/OB_REPORTING_DB
      definition:
        type: RDBMS
        configuration:
          jdbcUrl: 'jdbc:mysql://localhost:3306/openbank_ob_reporting_statsdb?autoReconnect=true&useSSL=false'
          username: 'root'
          password: 'root'
          driverClassName: 'com.mysql.jdbc.Driver'
          maxPoolSize: 20
          idleTimeout: 60000
          connectionTestQuery: SELECT 1
          # Use below for oracle database
          # connectionTestQuery: SELECT 1 FROM DUAL
          validationTimeout: 30000
          isAutoCommit: false
     
    - name: OB_REPORTING_SUMMARIZED_DB
      description: The datasource used to store statistics for OB Reporting module
      jndiConfig:
        name: jdbc/OB_REPORTING_SUMMARIZED_DB
      definition:
        type: RDBMS
        configuration:
          jdbcUrl: 'jdbc:mysql://localhost:3306/openbank_ob_reporting_summarizeddb?autoReconnect=true&useSSL=false'
          username: 'root'
          password: 'root'
          driverClassName: 'com.mysql.jdbc.Driver'
          maxPoolSize: 20
          idleTimeout: 60000
          connectionTestQuery: SELECT 1
          # Use below for oracle database
          # connectionTestQuery: SELECT 1 FROM DUAL
          validationTimeout: 30000
          isAutoCommit: false

Data Reporting API

If you're using a customised consent authentication web application, you may use the Data Reporting API to publish events from the application. Invoke the Data Reporting API in all the relevant places to publish the PSU and authorisation data to the reporting databases.

In the following scenarios, events are captured using the consent authorisation web app:

  • The user visiting the consent page
  • After the user authorising/denying the consent
Expand
titleClick here for sample requests
Note

In the scenarios above, Accounts, Payments or Confirmation of Funds (COF) API is invoked.  Given below are sample requests to invoke the Data Reporting API. Update the request body according to the scenario that you want to capture the events.

The user visiting the consent page

Localtabgroup
Localtab
titleAccounts
Code Block
curl --location --request POST 'https://<WSO2_OB_KM_HOST>:9446/api/openbanking/mireport/v1.0/analytics/account' \
--header 'Content-Type: application/json' \
--data-raw '{
  "consentId": "ffd2e946-acd0-49c9-9d45-d5983781f4b5",
  "clientId": "1234",
  "userId" : "psu1@wso2.com",
  "reAuth": "true",
  "timestamp" : "1560832453",
  "authorisationStatus" : "AuthorisationRequired"
}'
Localtab
titlePayments
Code Block
curl --location --request POST 'https://<WSO2_OB_KM_HOST>:9446/api/openbanking/mireport/v1.0/analytics/payment' \
--header 'Content-Type: application/json' \
--data-raw '{
  "consentId": "ffd2e946-acd0-49c9-9d45-d5983781f4b5",
  "clientId": "1234",
  "userId" : "psu1@wso2.com",
  "timestamp" : "15608324545",
  "authorisationStatus" : "AuthorisationRequired",
  "multiAuth" : "false",
  "multiAuthUsers" : 0
}'
Localtab
titleCOF
Code Block
curl --location --request POST 'https://<WSO2_OB_KM_HOST>:9446/api/openbanking/mireport/v1.0/analytics/fund-confirmation' \
--header 'Content-Type: application/json' \
--data-raw '{
  "consentId": "ffd2e946-acd0-49c9-9d45-d5983781f4b5",
  "clientId": "1234",
  "userId" : "psu1@wso2.com",
  "timestamp" : "15608324545",
  "authorisationStatus" : "AuthorisationRequired"
}'

After the user authorising/denying the consent

Localtabgroup
Localtab
titleAccounts
Code Block
curl --location --request POST 'https://<WSO2_OB_KM_HOST>:9446/api/openbanking/mireport/v1.0/analytics/account' \
--header 'Content-Type: application/json' \
--data-raw '{
  "consentId": "ffd2e946-acd0-49c9-9d45-d5983781f4b5",
  "clientId": "1234",
  "userId" : "psu1@wso2.com",
  "reAuth": "true",
  "debtorAccountIds": [
    "1233444",
    "9875432"
  ],
  "timestamp" : "1560832453",
  "authorisationStatus" : "Authorised"
}'
Localtab
titlePayments
Code Block
curl --location --request POST 'https://<WSO2_OB_KM_HOST>:9446/api/openbanking/mireport/v1.0/analytics/payment' \
--header 'Content-Type: application/json' \
  "consentId": "ffd2e946-acd0-49c9-9d45-d5983781f4b5",
  "clientId": "1234",
  "userId" : "psu1@wso2.com",
  "timestamp" : "15608324545",
  "debtorId" : "1223333343",
  "authorisationStatus" : "Authorised",
  "multiAuth" : "true",
  "multiAuthUsers" : 3
}'
Localtab
titleCOF
Code Block
Confirmation of Funds
curl --location --request POST 'https://<WSO2_OB_KM_HOST>:9446/api/openbanking/mireport/v1.0/analytics/fund-confirmation' \
--header 'Content-Type: application/json' \
--data-raw '{
  "consentId": "ffd2e946-acd0-49c9-9d45-d5983781f4b5",
  "clientId": "1234",
  "userId" : "psu1@wso2.com",
  "timestamp" : "15608324545",
  "debtorId" : "1223333343",
  "authorisationStatus" : "Authorised"
}'
Multiexcerpt
hiddentrue
MultiExcerptNameInvocationFailure

Capturing data during invocation failure scenarios

This is available only as a WUM update and is effective from December 20, 2019 (12-20-2019). For more information on updating WSO2 Open Banking, see  Updating WSO2 Products .

  1. Go to the <WSO2_OB_APIM_HOME>/repository/deployment/server/synapse-configs/default/sequences directory.
  2. Create an XML file named api_invocation_fail_data_publisher.xml with the following content: 

    xml
  3. Open the <WSO2_OB_APIM_HOME>/repository/deployment/server/synapse-configs/default/sequences/_throttle_out_handler_.xml file and add the OBErrorDataPublisher  class under the sequence tag. 

  4. Open the <WSO2_OB_APIM_HOME>/repository/deployment/server/synapse-configs/default/sequences/_auth_failure_handler_.xml file and add the OBErrorDataPublisher  class below the sequence key element as shown below: 

    xml