Reference Guide
API access
The base URL for production APIs is:
https://prod.api.quecto-ai.com/
Credentials
Your credentials are your client ID and your client secret.
Client ID
Your client ID is a unique identifier for your account.
Client secrets
Client secrets are unique passphrases that you generate to authorise your application.
The client secret is the equivalent of a password and should not be stored in plain text. Only store an encrypted version of the client secret to reduce the chance of it being compromised.
Rotate your client secret regularly
Rotate your application's client secret to shorten the period an access key is active, reducing the impact to your business if it is compromised.
To rotate your client secret:
- Generate a new client secret
- Update your application to use the new client secret
- Check that your application is working with the new client secret
- Delete the inactive client secret
- You can have up to 5 client secrets at any time.
Access token
The authorisation user journey is an important part of our security, and may be changed without notice.
Generate an access token
Do this via a POST to our token endpoint.
curl -X 'POST' \
'https://prod.api.quecto-ai.com/auth/token' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"client_id": "np2enFH1joCOxpAna0VplAuYu6co86",
"client_secret": "a93d91df-1ec0-4c5c-a971-b23a7d1b9c08",
"grant_type": "client_credentials"
}'
Parameter | Description | |
---|---|---|
client_id | The Client ID of your account | |
client_secret | One of the client secrets | |
grant_type | client_credentials |
The response contains the access token used for calling the APIs.
{
"access_token": "nVdVPGClwOnuQger1SD3XUu4wRAPoq",
"token_type": "Bearer",
"expires_in": 14400
}
Call API
You can now call an API using the access_token we issued
curl -X 'POST' \
'https://prod.api.quecto-ai.com/api/ab-test/get-or-assign' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H ‘Authorization: Bearer [ACCESS-TOKEN]’
-d '{
"abTestName": "CLIENT_AUTHENTICATION",
"userId": "123455677"
}'