Skip to content

API Overview & Authentication ​

ADBNK exposes a RESTful HTTP API in four groups:

GroupPrefixAuthDescription
Advertiser API/api/advertiserJWT BearerBackend for the advertiser console
Publisher API/api/publisherJWT BearerBackend for the publisher console
Ad Request API/adNoneReal-time ad requests from zones
Event Reporting API/trackNoneConversion 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:

http
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:

json
{
  "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:

json
{
  "code": 0,
  "message": "success",
  "data": {},
  "timestamp": 1752200000
}
FieldTypeDescription
codeintBusiness status code; 0 means success, non-zero means failure
messagestringHuman-readable message (localized by request language)
dataobject/array/nullBusiness data
timestampintServer 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:

codeHTTPMeaning
0200Success
400400Bad parameters / validation failure
401401Not logged in / invalid or expired token
403403Insufficient permission / account disabled / feature off
404404Resource not found
412412Precondition failed (profile incomplete / KYC not passed)
422422Semantic validation failure
429429Too many requests
500500Server error

Example error response:

json
{
  "code": 401,
  "message": "Invalid or expired token",
  "data": null,
  "timestamp": 1752200000
}

Pagination convention ​

List endpoints use these query parameters uniformly:

ParamTypeRequiredDefaultDescription
pageintNo1Page number, min 1
page_sizeintNo20Items per page, range 1–100
sort_fieldstringNoidSort field (whitelisted per endpoint)
sort_orderstringNodescSort direction: asc / desc

Paginated response structure:

json
{
  "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

Documentation released under the MIT License.