Track API
OpusCapita Track API enables Business Network customers to search, monitor and extract transaction event data in real-time. API offers same source data as the Track and trace application in the Business Network Portal. The API can be used for customer´s own reporting and monitoring applications.
If a customer uses robotics to retrieve transaction data, it's better to use the Track API instead of UI-based RPA tools. UI components frequently change, which can break these preprogrammed UI RPA tools.
Track API utilizes OpenID connect and OAuth 2.0 protocol for authentication.
This documentation gives you the basic overview of the implementation and usage of the API. For more detailed information, please check the documentation and specification links in the below table. Accessing the information requires login to Business Network Portal.
Getting access token
Track API is compliant with OAuth 2.0 authentication protocol. To access the API you must have an access token. An access token can be obtained from the Auth service using valid client and user credentials.
API credentials are provided to you as part of the implementation project:
clientID
clientSecret
userName
password
#!/bin/bash
CLIENT_ID=clientID
CLIENT_SECRET=clientSecret
USERNAME=userName
PASSWORD=password
opuscapitaHost=https://businessnetwork.opuscapita.com
ACCESS_TOKEN=$(curl -s -f -X POST -u $CLIENT_ID:$CLIENT_SECRET -d "grant_type=password&username=$USERNAME&password=$PASSWORD&scope=openid email userInfo roles" $opuscapitaHost/auth/token | jq --raw-output ".access_token")
echo $ACCESS_TOKEN
Calling Endpoint
having ACCESS_TOKEN you need to form and send Bearer Authentication header with each of you target api request
AUTH_HEADER="Authorization: Bearer $ACCESS_TOKEN"
body='{"filter": {}}'
curl -X POST -H "$AUTH_HEADER" -H "content-type:application/json" -d "$body" "$opuscapitaHost/track/api/transactions"
Request body: see above links to the Swagger documentation.