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.
Create credentials
Section titled “Create credentials”- Open Admin → Integrations → API Keys as a company administrator.
- Select Create API Key and enter a name that identifies the integration.
- Copy the Client ID, then reveal and copy the Client Secret. The secret is shown only at creation.
- Store them in your application’s secret manager.
An API key provides access to the endpoints in these guides for its company.
Get a bearer token
Section titled “Get a bearer token”Set REDJADE_CLIENT_ID and REDJADE_CLIENT_SECRET in your server environment, then run:
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:
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.
Send an authenticated request
Section titled “Send an authenticated request”Set REDJADE_TOKEN to the returned response.access_token:
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.
Rotate or revoke credentials
Section titled “Rotate or revoke credentials”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.