In this article:
API overview
Affilimate currently offers a basic API which is available to all publishers for the purpose of more customized integrations.
Please note that in order to use these APIs, you will need the help of a developer and such implementation falls outside the scope of standard support. Most publishers will use our default setup without any custom code.
APIs are grouped into the following categories:
- Basic API - Utility endpoints that allow you to trigger core system functions, such as a site scan and link import.
- Advanced API (Coming Soon) - Endpoints for advanced reporting, analysis, and transaction import and export.
Creating and revoking API tokens
To get started, visit the General Settings of your account and scroll down to the section called Secret API Tokens.
To create a new token
- Click the button called Create new token
- Provide a name for the token, such as the place where you intend to use or store the token
- Press Create token
- Copy the resulting token, and store it in a secure place
- Use the token to authenticate
To revoke an existing token
- In the list of Secret API Tokens, click the menu icon on the right side of the row containing the token you want to revoke
- Click the menu item called Revoke token
- Confirm revoking the token
Authentication
The resulting API token is a JWT that encodes information Affilimate needs to identify your space and grant access to specific resources.
You'll authenticate using Bearer Auth, and set the API token in the authorization header of all requests. For example:
curl \ -H "Authorization: Bearer REPLACE_WITH_YOUR_SECRET_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "url": "https://yourwebsite.com/newpost" }' \ https://api.affilimate.com/v1/content/publish