เอกสาร API
REST API แบบ JSON สำหรับดึงรายงาน ดูเว็บไซต์ และจัดการแคมเปญ ทุกคำขอใช้ HTTPS ที่ https://boapi.adflicko.com
การยืนยันตัวตน
สร้าง API key ได้ที่ ตั้งค่าบัญชี > API keys แล้วส่งใน header Authorization: Bearer adf_live_… ทุกคำขอ อย่าใส่ key ในโค้ดฝั่งเบราว์เซอร์
แต่ละ key เรียกได้ 60 ครั้งต่อนาที และเข้าถึงข้อมูลได้เท่ากับบัญชีเจ้าของ key
curl https://boapi.adflicko.com/boapi/auth/me \
-H "Authorization: Bearer adf_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"รายงาน
GET /boapi/reports ใช้ได้ทั้ง Publisher และ Advertiser จัดกลุ่มได้สูงสุด 2 มิติ
| พารามิเตอร์ | คำอธิบาย |
|---|---|
from, to | วันที่แบบ YYYY-MM-DD ช่วงห่างกันไม่เกิน 400 วัน |
group_by | day, country, device, os, site, zone, campaign (คั่นด้วยจุลภาคได้ 2 ค่า) |
view | publisher ดูรายได้จากเว็บของคุณ, advertiser ดูค่าโฆษณาของแคมเปญของคุณ |
tz | เขตเวลา IANA ค่าเริ่มต้น Asia/Bangkok |
site_id, zone_id, campaign_id, country | กรองข้อมูล (ไม่บังคับ) |
curl "https://boapi.adflicko.com/boapi/reports?from=2026-11-27&to=2026-12-03&group_by=day,country&view=publisher" \
-H "Authorization: Bearer adf_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"{
"data": [
{ "key": "2026-12-03", "secondary_key": "TH", "impressions": 24500, "invalid": 310,
"conversions": 18, "revenue": 31.85, "cpm": 1.3 }
],
"totals": { "impressions": 24500, "invalid": 310, "conversions": 18, "revenue": 31.85 },
"timezone": "Asia/Bangkok"
}GET /boapi/reports/export.csv ใช้พารามิเตอร์ชุดเดียวกัน และตอบเป็นไฟล์ CSV แบบ UTF-8 BOM ที่เปิดใน Excel ได้ทันที
curl -o report.csv "https://boapi.adflicko.com/boapi/reports/export.csv?from=2026-11-27&to=2026-12-03&group_by=day&view=publisher" \
-H "Authorization: Bearer adf_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"เว็บไซต์ (Publisher)
GET /boapi/publisher/overviewสรุปรายได้ views และยอดเงินคงเหลือ ช่วง 7, 14 หรือ 30 วัน (ใส่ในdays)GET /boapi/sitesรายการเว็บและ zone ของคุณ (กรองสถานะด้วยstatus)
curl "https://boapi.adflicko.com/boapi/publisher/overview?days=7" \
-H "Authorization: Bearer adf_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"{
"days": 7,
"current": { "impressions": 148200, "revenue": 192.66 },
"previous": { "impressions": 121000, "revenue": 154.8 },
"balance": { "available": 84.25, "on_hold": 42.1 },
"daily": [{ "date": "2026-12-03", "impressions": 24500, "revenue": 31.85 }],
"top_countries": [{ "country": "TH", "impressions": 110000, "revenue": 143.0 }],
"devices": [{ "device": "mobile", "impressions": 125000, "revenue": 162.5 }]
}curl https://boapi.adflicko.com/boapi/sites \
-H "Authorization: Bearer adf_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"{
"data": [
{ "id": "674f5a6b7c8d9e0f1a2b3c4d", "domain": "novelthai.example", "status": "active",
"zones": [{ "id": 48001, "formats": ["popunder", "direct_link"],
"freq_count": 1, "freq_hours": 24, "status": "active" }] }
]
}แคมเปญ (Advertiser)
GET /boapi/advertiser/campaignsรายการแคมเปญ กรองด้วยstatusหรือค้นชื่อด้วยqPOST /boapi/advertiser/campaignsสร้างแคมเปญใหม่ เริ่มที่สถานะรอตรวจPATCH /boapi/advertiser/campaigns/{id}แก้ราคา งบ การกระจายงบ หรือหยุดและเริ่มแคมเปญ
แคมเปญใหม่และการแก้ URL หรือกลุ่มเป้าหมายต้องผ่านการตรวจก่อนแสดง ส่วนการแก้ราคา งบ และสถานะมีผลทันที
bid_cpm ต้องไม่ต่ำกว่าราคาขั้นต่ำของประเทศที่เลือก และ daily_budget ต้องอย่างน้อย $5.00
curl "https://boapi.adflicko.com/boapi/advertiser/campaigns?status=active" \
-H "Authorization: Bearer adf_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"curl -X POST https://boapi.adflicko.com/boapi/advertiser/campaigns \
-H "Authorization: Bearer adf_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"name": "TH Mobile Popunder",
"format": "popunder",
"target_url": "https://example.com/offer?cid={click_id}&z={zone_id}&cc={country}",
"category": "ecommerce",
"targeting": { "countries": ["TH"], "devices": ["mobile"], "os": ["android", "ios"] },
"bid_cpm": 1.85,
"daily_budget": 25.00,
"pacing": "even"
}'curl -X PATCH https://boapi.adflicko.com/boapi/advertiser/campaigns/91001 \
-H "Authorization: Bearer adf_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{ "status": "paused" }'เครดิตโฆษณา (Advertiser)
GET /boapi/credits ให้ยอดเครดิตโฆษณาคงเหลือเป็น USD และ GET /boapi/credits/transactions ให้ประวัติการเติมเครดิตและค่าโฆษณา
curl https://boapi.adflicko.com/boapi/credits \
-H "Authorization: Bearer adf_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"{ "balance": 120.5, "credit_balance": 120.5, "balance_micro": 120500000, "currency": "USD" }Postback (นับ conversion)
ใส่ {click_id} ใน target_url ของแคมเปญ เมื่อมี conversion ให้ระบบของคุณเรียก URL นี้แบบ server-to-server พร้อม click_id ที่ได้รับ ระบบรับ GET และนับ click_id ละ 1 ครั้งต่อ event
มาโครที่ใส่ใน target_url ได้: {click_id} รหัสคลิก, {zone_id} zone ที่แสดงโฆษณา และ {country} ประเทศของผู้ชม
https://example.com/offer?cid={click_id}&z={zone_id}&cc={country}https://t.adflicko.com/capi/pb?click_id={click_id}&payout={payout}&event=conversion&key=pb_xxxxxxxxxxxxxxxxxxxxxxxx| พารามิเตอร์ | คำอธิบาย |
|---|---|
click_id | รหัสคลิกที่ได้จาก {click_id} ระบบค้นย้อนหลังได้ 30 วัน |
payout | ยอดต่อ conversion เป็น USD (ไม่บังคับ) |
event | ชื่อเหตุการณ์ เช่น conversion, lead, sale, deposit |
key | รหัสลับ Postback ของบัญชี (pb_…) ดูได้จาก GET /boapi/advertiser/postback-key ถ้าบัญชีมีรหัสลับแต่ส่งไม่ตรง ระบบตอบ 403 invalid_postback_key |
แต่ละคู่ (click_id, event) นับครั้งเดียว ถ้าส่งซ้ำระบบตอบ "counted": false จึงส่งซ้ำได้อย่างปลอดภัย
{ "ok": true, "counted": true }
// the same click_id and event again
{ "ok": true, "counted": false, "reason": "duplicate" }ข้อผิดพลาดและขีดจำกัด
ข้อผิดพลาดตอบได้ 2 รูปแบบ ให้ตรวจที่ code เสมอ ส่วนข้อความเป็นภาษาของบัญชีและอาจเปลี่ยนได้
{
"error": "Your IP address is not on this account's IP whitelist",
"code": "ip_not_allowed"
}{
"error": {
"code": "bid_below_floor",
"message": "bid_cpm must be at least 1.20 for the selected countries",
"field": "bid_cpm"
}
}| HTTP | code | ความหมาย |
|---|---|---|
| 400 | bid_below_floor | bid_cpm ต่ำกว่าราคาขั้นต่ำของประเทศที่เลือก |
| 401 | unauthorized | ไม่มี key, key ผิด หรือ key ถูกยกเลิกแล้ว |
| 401 | ip_not_allowed | บัญชีเปิดจำกัด IP ไว้ และ IP ที่เรียกไม่อยู่ในรายการ |
| 403 | forbidden | บัญชีนี้ไม่มีสิทธิ์ทำสิ่งนี้ |
| 403 | invalid_postback_key | key ของ postback ไม่ตรงกับรหัสลับของบัญชี |
| 404 | not_found | ไม่พบข้อมูล หรือไม่ใช่ของบัญชีนี้ |
| 429 | rate_limited | เรียกเกิน 60 ครั้งต่อนาที ดู header Retry-After |