Skip to main content
Prefix the paths below with your service URL. Obtain an access token first, then send it in the Authorization header when calling other endpoints. Keep your credentials and token secure. Obtaining a new token invalidates the previous one.

1.Get an access token

POST /wapi/token/ with a JSON body:
FieldDescription
usernameAccount email; required
passwdAccount password; required
On success, use results.token as your access token:
Accounts that have purchased a Dynamic GB or Premium Dynamic GB package, or redeemed Dynamic traffic, can obtain a token. This endpoint is rate-limited; retry later if you receive HTTP 429.

2.Query Dynamic GB traffic usage

GET /wapi/consume/dynamic/chart/
Query parameterDescription
sunameSub-account username; omit or leave empty to query the main account
stStart time, Unix seconds
etEnd time, Unix seconds
Example: GET /wapi/consume/dynamic/chart/?suname=sub_account&st=1735689600&et=1735776000 Accounts that have purchased a Dynamic GB or Advanced Dynamic GB package, or redeemed Dynamic traffic, can use this endpoint.

3.Query Premium Dynamic GB traffic usage

GET /wapi/consume/premium/chart/ Use the same header, query parameters, and response format as the Dynamic GB usage endpoint. Example: GET /wapi/consume/premium/chart/?suname=sub_account&st=1735689600&et=1735776000. Accounts that have purchased a Premium Dynamic GB package can use this endpoint. Both usage endpoints follow these rules:
  • If either st or et is omitted or not greater than 0, the query covers midnight to now in the account’s time zone.
  • If st equals et, the query covers one day from that time. A start time after the end time produces a parameter error.
  • resultscontains time-ordered data points.periodidentifies the time interval,timestampis its Unix timestamp in seconds, andtotal_traffic_count` is traffic used during that interval, in bytes. Intervals without usage return 0.
Example response (values are illustrative):

4.Create redemption codes (CDKs) in batch

POST /wapi/cdk/create/
FieldDescription
cdk_typeRequired: 1 Dynamic traffic, 2 IP count, 3 Mobile traffic
flowRequired for types 1 and 3; traffic per code in GB, from 1 to 10000
ipRequired for type 2; IP count per code, from 1 to 10000
dayValidity period in days for types 1 and 3
numRequired; number of codes to create, from 1 to 10000
Example for Dynamic traffic codes:
On success, results lists the generated codes. Cdk is the redemption code, Type is its type, Flow is in bytes, Ip is the IP count, and Days is the validity period:
Ensure your account has enough of the corresponding resource. If it does not, the entire batch fails. Do not submit identical creation requests concurrently. This endpoint is rate-limited; retry later if you receive HTTP 429.

Common errors

Always check code in the response: some business errors are returned with HTTP 200.