Run export using REST service

Steps

  • Step 1: Generate JWT and find export key
  • Step 2: Build call, fill params and get results

The following calls will be addressed to MOSA DEMO environment. For other institutions, please replace MOSA by the expected code.

Step 1: Generate JWT and find export key

To find the active queries, you can use the endpoint https://secutix.ws.secutix.com/tnai/backend-apis/dataExportService/v1_0/getAvailableExports and make a POST call as described in the documentation here

For this institution, you can generate the JWT with the tool provided in our JWT Generator with the following parameters:

  • Virtual operator: MOSA_DAT
  • Partner name: Test
  • Secret key: your-256-bit-secret

The JWT generated is:

eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJNT1NBIiwiYXVkIjoiTU9TQV9EQVQiLCJpc3MiOiJUZXN0IiwiaWF0IjoxNjA2OTg0ODI1LCJleHAiOjE2MDY5ODU3MjV9.2tB7FdocRC2oZTieTOJ5rsY-L7AMAleSpPYk84Q6gJQ

Don't forget to generate your own! The above token lasts for 15 minutes since its generation.

Generate token using API

Above example is only intended for testing. To create tokens we have provided an endpoint as shown in the documentation.

With the same data, we can generate a call like this:

curl --location --request POST 'https://mosa.demo-ws.secutix.com/tnai/backend-apis/v1/auth' \
--header 'Content-Type: application/json' \
--data-raw '{
    "operator": "MOSA_DAT",
    "secret": "your-256-bit-secret"
}'

Getting a response like:

{
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJNT1NBIiwiYXVkIjoiTU9TQV9EQVQiLCJleHAiOjE2MDcwNzM1NjksImlhdCI6MTYwNzA3MzI2OX0.JmT5ZsWPLD_zgo2jl505eK2xO5G3BQjAx3Az3ulPdK0"
}

Request

Now we can run the call to get the available exports. Do it with a POST request:

curl --location --request POST 'https://mosa.demo-ws.secutix.com/tnai/backend-apis/dataExportService/v1_0/getAvailableExports' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJNT1NBIiwiYXVkIjoiTU9TQV9EQVQiLCJpc3MiOiJUZXN0IiwiaWF0IjoxNjA2OTg0ODI1LCJleHAiOjE2MDY5ODU3MjV9.2tB7FdocRC2oZTieTOJ5rsY-L7AMAleSpPYk84Q6gJQ'

Response

Getting the following response:

{
    "statusCode": "success",
    "statusDetail": null,
    "requestId": null,
    "exports": [
        {
            "exportKey": "EXPORT_TECH4TEAM",
            "exportParameterNames": []
        },
        {
            "exportKey": "GET_PAYMETH_CODE_AND_ID",
            "exportParameterNames": []
        }
    ]
}

For this example, the key GET_PAYMETH_CODE_AND_ID is used.

Step 2: Build call, fill params and get results

Once you have the export key, go ahead and read the documentation in Swagger

For this specific call, no dateFrom or dateTo are in use, but you can include them anyway to see their format.

Request

Type: GET

curl --location --request GET 'https://mosa.demo-ws.secutix.com/tnai/backend-apis/dataExportService/v1/export/GET_PAYMETH_CODE_AND_ID' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJNT1NBIiwiYXVkIjoiTU9TQV9EQVQiLCJpc3MiOiJUZXN0IiwiaWF0IjoxNjA2OTg0ODI1LCJleHAiOjE2MDY5ODU3MjV9.2tB7FdocRC2oZTieTOJ5rsY-L7AMAleSpPYk84Q6gJQ'

Response

{
    "statusCode": "success",
    "statusDetail": null,
    "exportDate": "2020-12-03T08:49:33.992+00:00",
    "exportedElements": [
        {
            "paymethId": "129838219",
            "idCode": "REFUND_ALIAS"
        },
        {
            "paymethId": "935793488",
            "idCode": "REF_BT_TO_APPROVE"
        },
        {
            "paymethId": "935793489",
            "idCode": "REF_EPP_TO_APPROVE"
        },
        {
            "paymethId": "935793490",
            "idCode": "REF_POS_TO_APPROVE"
        },
        {
            "paymethId": "141833281",
            "idCode": "REFUND_IN_PROGRESS"
        },
        {
            "paymethId": "935793482",
            "idCode": "REFUND_TO_APPROVE"
        },
        {
            "paymethId": "935793483",
            "idCode": "REF_REJECTED"
        },
        {
            "paymethId": "935793484",
            "idCode": "REF_SAP_EPP_PROCESSED"
        },
        {
            "paymethId": "935793485",
            "idCode": "REF_SAP_BT_PROCESSED"
        },
        {
            "paymethId": "935793486",
            "idCode": "REF_SAP_POS_PROCESSED"
        },
        {
            "paymethId": "935793487",
            "idCode": "REF_SAP_FAILED"
        }
    ]
}

You can add additional parameters that would be required by the query executed. It's as simple as add the key=value as a query parameter:

curl --location --request GET 'https://mosa.demo-ws.secutix.com/tnai/backend-apis/dataExportService/v1/export/GET_PAYMETH_CODE_AND_ID?ids=12345,9876' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJNT1NBIiwiYXVkIjoiTU9TQV9EQVQiLCJpc3MiOiJUZXN0IiwiaWF0IjoxNjA2OTg0ODI1LCJleHAiOjE2MDY5ODU3MjV9.2tB7FdocRC2oZTieTOJ5rsY-L7AMAleSpPYk84Q6gJQ'

Note in this call, at the end, ids=12345,9876 is included as parameter.