API Overview & Authentication
ADBNK exposes a RESTful HTTP API in four groups:
| Group | Prefix | Auth | Description |
|---|---|---|---|
| Advertiser API | /api/advertiser | JWT Bearer | Backend for the advertiser console |
| Publisher API | /api/publisher | JWT Bearer | Backend for the publisher console |
| Ad Request API | /ad | None | Real-time ad requests from zones |
| Event Reporting API | /track | None | Conversion reporting & tracking |
Base URL: https://api.adbnk.co
Authentication
The advertiser / publisher endpoints use JWT Bearer Token auth. First call the corresponding login endpoint to get a token, then carry it in the Authorization header of every request:
Authorization: Bearer <token>Always send the token in the request header; don't put it in the URL.
Token type and path must match
An advertiser token can only access /api/advertiser/*, and a publisher token can only access /api/publisher/*; cross-role access returns 401.
Example successful login response:
{
"code": 0,
"message": "Login successful",
"data": {
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9....",
"token_type": "Bearer",
"expires_in": 86400,
"user": { "id": 1, "username": "demo", "email": "[email protected]" }
},
"timestamp": 1752200000
}Unified response envelope
All endpoints return a unified JSON envelope:
{
"code": 0,
"message": "success",
"data": {},
"timestamp": 1752200000
}| Field | Type | Description |
|---|---|---|
code | int | Business status code; 0 means success, non-zero means failure |
message | string | Human-readable message (localized by request language) |
data | object/array/null | Business data |
timestamp | int | Server Unix timestamp (seconds) |
When message comes from an i18n translation key, the response also carries message_key (and optionally message_params) for frontend re-localization.
Dual status codes
code is the primary business signal (0 = success). The HTTP status code is also aligned with code (200 on success, errors mapped to the corresponding 4xx/5xx), making it easy for CDN / WAF / monitoring to recognize error rates.
Error code convention
code reuses HTTP semantics; common values:
| code | HTTP | Meaning |
|---|---|---|
0 | 200 | Success |
400 | 400 | Bad parameters / validation failure |
401 | 401 | Not logged in / invalid or expired token |
403 | 403 | Insufficient permission / account disabled / feature off |
404 | 404 | Resource not found |
412 | 412 | Precondition failed (profile incomplete / KYC not passed) |
422 | 422 | Semantic validation failure |
429 | 429 | Too many requests |
500 | 500 | Server error |
Example error response:
{
"code": 401,
"message": "Invalid or expired token",
"data": null,
"timestamp": 1752200000
}Pagination convention
List endpoints use these query parameters uniformly:
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
page | int | No | 1 | Page number, min 1 |
page_size | int | No | 20 | Items per page, range 1–100 |
sort_field | string | No | id | Sort field (whitelisted per endpoint) |
sort_order | string | No | desc | Sort direction: asc / desc |
Paginated response structure:
{
"code": 0,
"message": "success",
"data": {
"list": [],
"pagination": {
"total": 135,
"page": 1,
"page_size": 20,
"total_pages": 7
}
},
"timestamp": 1752200000
}Rate limiting
The platform doesn't apply uniform rate limiting to all endpoints, but it throttles sensitive operations:
- Forgot password: requests for the same email that are too frequent return
429. - Event reporting: only valid traffic is billed; the settlement statement is final.
WARNING
Specific thresholds may change with platform configuration; refer to the actual response.
CORS
Call the API from your own server; browser cross-origin calls are not supported.
Continue reading: Advertiser API · Publisher API · Ad Request API · Events & Conversion Reporting