Skip to main content

Guides for your firm. An API reference for your scripts.

Get an access token, then call the API

  1. Get an access tokenYour script asks for a code, a person approves the code in a browser, and your script receives tokens.
    # 1. Start. Show verification_uri_complete, or verification_uri and user_code, to the person.
    curl -s -X POST "https://$ISSUER_HOST/oauth/device/code" \
    -d client_id="$CLIENT_ID" -d audience="$SCRIPT_AUDIENCE" \
    -d scope="offline_access read:firm"

    # 2. Poll every `interval` seconds until the person approves.
    # Save refresh_token before you use access_token.
    curl -s -X POST "https://$ISSUER_HOST/oauth/token" \
    -d grant_type="urn:ietf:params:oauth:grant-type:device_code" \
    -d device_code="$DEVICE_CODE" -d client_id="$CLIENT_ID"
    Authentication
  2. Call the APICall the API with the access token as a bearer token in the Authorization header.
    curl -s "$API_ROOT/v1/firm/risk" -H "Authorization: Bearer $ACCESS_TOKEN"
    List risk levels

$API_ROOT is the base URL, https://app.advicecloudft.com/api. The Authentication section explains the other values.