Skip to content
Console

S4 static CDN API

Get a console API token

Get one from the console: https://console.bitiful.com/apiToken

Data transfer

Parameters

start_time - Start time, timestamp, in seconds

end_time - End time, timestamp, in seconds

period - Aggregation interval. One of hourly / daily / monthly.

Edge traffic

curl --get -H "Authorization: {API Token from: https://console.bitiful.com/apiToken}" "https://api.bitiful.com/cdn/data/{cdn-domain}/traffic?start_time={start_time}&end_time={end_time}&period={period}"

Origin fetch traffic

curl --get -H "Authorization: {API Token from: https://console.bitiful.com/apiToken}" "https://api.bitiful.com/cdn/data/{cdn-domain}/traffic_origin?start_time={start_time}&end_time={end_time}&period={period}"

Requests

Parameters

start_time Start time, timestamp, in seconds

end_time End time, timestamp, in seconds

period Aggregation interval. One of hourly / daily / monthly.

Edge requests

curl --get -H "Authorization: {API Token from: https://console.bitiful.com/apiToken}" "https://api.bitiful.com/cdn/data/{cdn-domain}/request?start_time={start_time}&end_time={end_time}&period={period}"

Origin fetch requests

curl --get -H "Authorization: {API Token from: https://console.bitiful.com/apiToken}" "https://api.bitiful.com/cdn/data/{cdn-domain}/request_origin?start_time={start_time}&end_time={end_time}&period={period}"

CDN real-time logs

Only logs from the last 3 days are available.

Parameters

start_time Start time as a timestamp in nanoseconds, used for pagination. Example: 1723046499000000000

codes Filter by HTTP status code. One of 2XX / 3XX / 4XX / 5XX / ALL. Defaults to ALL.

limit Number of entries to return per request. Maximum: 1000.

curl -H "Authorization: {API Token from: https://console.bitiful.com/apiToken}" "https://api.bitiful.com/cdn/data/{cdn-domain}/logs?start_time={start_time}&codes={codes}&limit={limit}"

Purge the CDN cache

Request

Method: POST

Content-Type: application/json

Parameters

type Purge type: url or directory, which purge URLs or directories respectively.

url_list Array of strings listing the URLs/directories to purge. The array can contain at most 20 elements, and URLs can't contain the asterisk character *. If a directory or file name in a URL contains special characters such as %, URL-encode it first.

curl -X POST -H "Authorization: {API Token from: https://console.bitiful.com/apiToken}" "https://api.bitiful.com/cdn/cache/refresh" -d '{"type": "url", "url_list": ["https://xxx.com/yyy/zzz.png", "https://aaa.com/bbb/ccc.png"]}'