Skip to content

Authenticate API requests

Exchange your application’s Client ID and Client Secret for a bearer token, then include the token in API requests. The base URL is https://app.redjade.net/api/v1.

Keep the Client Secret and bearer token on your server. Use the URL provided by RedJade if your integration has a separate test environment.

  1. Open Admin → Integrations → API Keys as a company administrator.
  2. Select Create API Key and enter a name that identifies the integration.
  3. Copy the Client ID, then reveal and copy the Client Secret. The secret is shown only at creation.
  4. Store them in your application’s secret manager.

An API key provides access to the endpoints in these guides for its company.

Set REDJADE_CLIENT_ID and REDJADE_CLIENT_SECRET in your server environment, then run:

Terminal window
curl --fail-with-body --request POST \
'https://app.redjade.net/api/v1/oauth/access_token' \
--data-urlencode "client_id=$REDJADE_CLIENT_ID" \
--data-urlencode "client_secret=$REDJADE_CLIENT_SECRET"

The token is returned in response.access_token:

{
"response": {
"access_token": "YOUR_BEARER_TOKEN",
"token_type": "Bearer"
}
}

The token is valid for one hour. Cache it on your server and request a token again when it expires. A token request can return the same value with a renewed expiry.

Set REDJADE_TOKEN to the returned response.access_token:

Terminal window
curl --fail-with-body \
'https://app.redjade.net/api/v1/sensory_tests?page=1&per=10' \
--header "Authorization: Bearer $REDJADE_TOKEN"

This request lists your company’s tests. The test objects are returned in response; see Download study data for pagination and data downloads.

Create a replacement API key, update your application, and verify a request with the new credentials. Delete the old key from Admin → Integrations → API Keys after the replacement works. A lost Client Secret cannot be retrieved; create a new key.

See API errors for authentication failures and request errors.