Authentication
Obtaining Your Credentials
The Affiliate API uses two credentials to authorize requests:- Access Token: An OAuth2 bearer token tied to the affiliate’s session
- Account ID: Identifies the FirstPromoter company account
- Log in to the affiliate dashboard
- Open your browser’s DevTools (F12 or right-click → Inspect) and go to the Network tab
- Reload the page or perform any action to trigger an API request
- Click on any request to
v2.firstpromoter.com - Under Request Headers, you will find:
Authorization: Bearer {your_access_token}
/me endpoint using your access token and look for the cid field in the response:
cid value inside the company object in the response is your Account ID.
Making Authenticated Requests
All API requests must include both credentials in your request headers:Example Request
Replace
{your_access_token} with the bearer token from the Network tab and {your_account_id} with the account ID found in the same request headers.Security Best Practices
- Never expose your access token in client-side code or public repositories
- Use HTTPS for all API communications
- Retrieve a fresh token if requests start returning
401 Unauthorized