Skip to content

Authentication

If you are accessing our product programatically, the following options are available to successfully authenticate.

Tip

If the following don't meet the needs of your use case, please consult the different methods available for acquiring tokens on the Official Microsoft Entra ID documentation, and of course feel free to reach out to us for support.

Beta Python SDK

See the Beta SDK Documentation for instructions.

Azure CLI

The Azure CLI simplifies the process of acquiring an access token that can be used when making requests.

Pre requisites

  1. Follow the How to install the Azure CLI if you haven't installed it yet.
  1. Once you have a valid installation make sure you have logged in, specifying the correct scope:

    az login --scope api://c0a9f773-6276-4d71-8df6-7239e695aff6/.default --allow-no-subscriptions
    

    Note

    If you want to sign in with methods other than interactively with your personal user see the instructions on the official docs

  2. To acquire an access token:

    export ACCESS_TOKEN=$(az account get-access-token --resource api://c0a9f773-6276-4d71-8df6-7239e695aff6 --query "[accessToken]" -o tsv)
    
  3. You can now use the ACCESS_TOKEN in the Bearer token when making requess to the API, for example:

    curl -s --header "Authorization: Bearer $ACCESS_TOKEN" "https://api.fabapps.io/v3/rk_within_day/models"
    

    Tip

    If you have jq installed in your shell you can get a well formatted response by piping the curl response to jq:

    curl -s --header "Authorization: Bearer $ACCESS_TOKEN" "https://api.fabapps.io/v3/rk_within_day/models" | jq .
    
  1. Once you have a valid installation make sure you have logged in, specifying the correct scope:

    az login --scope api://beta.optimeering.com/.default --allow-no-subscriptions
    

    Note

    If you want to sign in with methods other than interactively with your personal user see the instructions on the official docs

  2. To acquire an access token:

    export ACCESS_TOKEN=$(az account get-access-token --resource api://beta.optimeering.com --query "[accessToken]" -o tsv)
    
  3. You can now use the ACCESS_TOKEN in the Bearer token when making requess to the API, for example:

    curl -s --header "Authorization: Bearer $ACCESS_TOKEN" "https://beta.optimeering.com/api/parameters/market"
    

    Tip

    If you have jq installed in your shell you can get a well formatted response by piping the curl response to jq:

    curl -s --header "Authorization: Bearer $ACCESS_TOKEN" "https://beta.optimeering.com/api/parameters/market" | jq .
    

Curl with Service Credentials

The following example uses Service Credentials to obtain an access token, which can then be used in subsequent requests. This method should be transferable to any programming language.

Note

The following is not yet supported for beta.optimeering.com.

See Obtaining Service Credentials for instructions to poulate the environment variables CLIENT_ID and CLIENT_SECRET.

Generate a token by running the following:

TENANT_ID="d23844a4-14b7-4e42-9e3a-be7fcb83625b"
CLIENT_ID="<<Replace With Client ID>>"
CLIENT_SECRET="<<Replace With Client Secret>>"

ACCESS_TOKEN=$(curl -s -XPOST https://login.microsoftonline.com/$TENANT_ID/oauth2/v2.0/token -d grant_type=client_credentials -d client_id=$CLIENT_ID -d client_secret="$CLIENT_SECRET" -d scope="api://c0a9f773-6276-4d71-8df6-7239e695aff6/.default" | awk -F'"' '/access_token/{print $(NF-1)}')

You can then use the token to query the API, for example:

curl -s --header "Authorization: Bearer $ACCESS_TOKEN" "https://api.fabapps.io/v3/rk_within_day/models"
Powered by the Engineering Team