Skip to content

Authentication & Access

Both the Targeton API and the Sample API use the same credentials and authentication mechanism.

Mechanism

Authentication is handled using the OAuth 2.0 Client Credentials flow.

To authenticate with the MAVE API:

  1. Send a request to the OAuth2 token endpoint with your client_id, client_secret, and grant_type=client_credentials.
  2. Receive an OAuth2 bearer token in the response.
  3. Include the bearer token in the Authorization header of all subsequent API requests.

Example header:

Authorization: Bearer <access_token>

Example token request body:

grant_type=client_credentials
client_id=<client_id>
client_secret=<client_secret>
scope=<scope>

Obtaining Credentials

Keep credentials secret

Client credentials are sensitive. Do not commit them to source control or share them in plain text. Use a secrets manager or environment variables.

Use an OAuth client library

For token management and automatic refresh, we recommend using an OAuth-recommended client library rather than implementing the flow manually.

Token Exchange

Exchange your credentials for a bearer token by posting to the token endpoint.

The response will include an access_token and its expires_in duration (in seconds). Tokens should be cached and refreshed before expiry.

Using the Token

Pass the token as a bearer token header on all requests to both APIs:

curl 'https://api.example.com/mave/targeton/v1?name=GREB_A_4_pel370' \
--header 'Authorization: Bearer <access_token>'
curl 'https://api.example.com/mave/sample/v1?run_ids=50955' \
--header 'Authorization: Bearer <access_token>'

Rate Limiting

The APIs have built-in rate limiting. If you exceed the limit you will receive a 429 Too Many Requests response. Implement retry logic with exponential backoff to handle this gracefully.