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.
...
Environment | Documentation | Json spec |
---|---|---|
Test - Stage | https://stage.businessnetwork.opuscapita.com/track/api/docs/ | stage.businessnetwork.opuscapita.com/track/api/open-api-spec.json |
Production |
...
Getting access token
Track API is compliant with OAuth 2.0 authentication protocol. You need below credentials, including a client ID and client secret, to authenticate API-users and gain access to OpusCapita Track API endpoints. . 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:
Client ID
Client secret
User name
Password
Endpoints
Below endpoint examples are for the testing environment.
Authorization:
clientID
clientSecret
userName
password
#!/bin/bash
CLIENT_ID=clientID
CLIENT_SECRET=clientSecret
USERNAME=userName
PASSWORD=password
opuscapitaHost=https://
stage.businessnetwork.opuscapita.com
/authorizeRequest header:
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.
...