Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

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.

...

  • 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")
AUTH_HEADER="Authorization: Bearer $ACCESS_TOKEN"
echo $AUTH_HEADER

Calling Endpoint

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.

...