Getting started
Getting started with the Sublime Ads API is easy.
First you will need your API key. This can be found on your account page, under API Keys.
To copy, just click/tap the box and use the usual copy command for your operating system.
Each time you call the API you need to append your token in your query string. Alternatively, you can add a "Authorization" header with your token.
We'll call the API Key a "token" from now on to avoid confusion.
If you'd like to keep your API Keys separate for each app or integration you can do this by adding a name and pressing Create
in the dialog.
Below you can see an example of multiple API Keys. Note that the Default key cannot be deleted. You can, however, always regenerate a key - just in case you wrote it down on a piece of paper and left it in the coffee shop ☕️ (it happens!)
Hello Sublime Ads
To test your token you can call the following endpoint:
https://sublimeads.com/api/hello_key
Pass in your token as a URL parameter:
https://sublimeads.com/api/hello_key?token=yourTokenGoesHere
On success the API will return a 200 OK and a message welcoming you with your given name. A timestamp is also provided. Here is an example reply:
{"message":"Hello from Sublime Ads, Vincent! 🖖","now":"2020-06-11T17:17:34.026Z"}
Feel free to use this endpoint to check for availability of Sublime Ads and validity of your token.
Authorization
Sublime Ads allows you to authenticate with either a token
parameter or a Authorization
header.
Most of the documentation is showing you a token
based approach. To use the Authorization
bearer token, use the example to guide you:
fetch("https://sublimeads.com/api/hello_key", {
"method": "GET",
"headers": {
"Authorization": "Bearer YOUR_API_TOKEN_GOES_HERE"
}
})
The important part being: "Authorization": "Bearer YOUR_API_TOKEN_GOES_HERE"
That will work the exact same way as what you're used to with a token based approach.
It is up to you which method of authentication you want to use.
Fair usage
Please adhere to the Fair Usage policy. If you feel you're going to hit some of those limits just let us know [email protected]
.
Usage calls are for the current rolling month, irrespective of when you signed up. Each month it will reset.
Limits are not hard limits
API call limits are not currently strictly enforced. We'll reach out to you when we think your chosen plan does not correspond to the api fair usage limits.
We will reach out to you when we think it's time to upgrade your account. You will have 7 days to upgrade your account. If you continue to use the same plan with the same usage we may disable your account. Check our fair usage terms for more information.
Extra parameters
We allow for extra parameters to be set for the ad and category endpoints. Check out the ad optional data parameters to get started.