Authentication
Every API call is authenticated with three HTTP headers. Your SecretKey is never transmitted - it is only used to derive the token.
| Parameter | Located in | Description |
|---|---|---|
ApiKey | HTTP header | Identifies your API account. If it is ever exposed, contact support immediately so we can rotate it for you. |
Timespan | HTTP header | Unix timestamp, second precision. |
Token | HTTP header | 32-character uppercase MD5 hash of ApiKey + Timespan + SecretKey. |
SecretKey | Do not transmit | Keep it secure. Open the avatar menu and choose My account - Credentials & access. |
Token generation
import hashlib, time, requests
API_KEY = "YOUR_API_KEY"
SECRET_KEY = "YOUR_SECRET_KEY"
timespan = str(int(time.time()))
token = hashlib.md5((API_KEY + timespan + SECRET_KEY).encode()).hexdigest().upper()
headers = {
"ApiKey": API_KEY,
"Timespan": timespan,
"Token": token, # 32-char UPPERCASE MD5
"Content-Type": "application/json",
}
resp = requests.get(BASE_URL + ENDPOINT, params=params, headers=headers)
data = resp.json() # check data["status"], not just HTTP 200
The two classic mistakes behind error 115: a lowercase token (it must be uppercase MD5) and server clock drift (the Timespan is valid for 300 seconds).