การกำหนดค่าสคริปต์ Super Marketing
หน้านี้บันทึก API endpoints สำหรับสคริปต์ Super Marketing แตกต่างจากสคริปต์อื่น ๆ Super Marketing ไม่ได้ สร้างผ่าน endpoint POST /api/v1/task ทั่วไป — แต่ทำงานบน ชุดข้อมูล เป้าหมายที่นำกลับมาใช้ใหม่ได้ และมี endpoints เฉพาะของตัวเอง
ภาพรวม
แคมเปญ Super Marketing รวมหลายการดำเนินการเพื่อการเติบโต (ติดตาม, เลิกติดตาม, รายงาน, DM, บูสต์, คอมเมนต์จำนวนมาก) ไว้ในการรันเดียวบนกลุ่มเป้าหมาย กลุ่มเป้าหมายจัดเก็บเป็น ชุดข้อมูล:
- ประเภทข้อมูล — ชุดข้อมูลเก็บ
usernames(ชื่อผู้ใช้ TikTok/Instagram) หรือpost_links(URL โพสต์) - กลยุทธ์ — ควบคุมการกระจายเป้าหมายไปยังอุปกรณ์:
shared_pool— ทุกอุปกรณ์/บัญชีที่เลือกจัดการ เป้าหมายทั้งหมดconsume_once— เป้าหมายถูก แบ่ง ระหว่างอุปกรณ์และแต่ละอันถูกใช้ครั้งเดียว
ขั้นตอนทั่วไป:
- นำเข้า เป้าหมายลงในชุดข้อมูล → รับ
dataset_id - รัน แคมเปญที่อ้างอิง
dataset_idนั้นบนอุปกรณ์หนึ่งหรือมากกว่า
การสลับฟีเจอร์ (ติดตาม / DM / คอมเมนต์ ฯลฯ) และการตั้งค่าโดยละเอียดอ่านจากการกำหนดค่าที่บันทึกไว้ในแอปเดสก์ท็อป (super_marketing_settings.json) คุณสามารถแทนที่ค่าใด ๆ ต่อการรันโดยส่ง script_config ในคำขอรัน
endpoints Super Marketing ทั้งหมดต้องใช้แผน Pro, Team หรือ Business เหมือนกับส่วนอื่นของ Local API
นำเข้าชุดข้อมูล
สร้างชุดข้อมูลใหม่หรือเพิ่มเป้าหมายลงในชุ ดข้อมูลที่มีอยู่
- Endpoint:
POST /api/v1/super-marketing/dataset
Request Body
| ฟิลด์ | ชนิด | จำเป็น | ค่าเริ่มต้น | คำอธิบาย |
|---|---|---|---|---|
| dataset_id | integer | No | — | ID ชุดข้อมูลที่มีอยู่สำหรับต่อท้าย/แทนที่ ละเว้นหรือใช้ 0 เพื่อสร้างชุดข้อมูลใหม่ |
| data_type | string | Yes | — | usernames หรือ post_links |
| strategy | string | Yes | — | shared_pool หรือ consume_once |
| entries | string[] | Yes* | [] | เป้าหมายเป็น JSON array มีความสำคัญเหนือ raw_text |
| raw_text | string | Yes* | — | เป้าหมายเป็นสตริงคั่นด้วยบรรทัดใหม่ (ทางเลือกแทน entries) |
| mode | string | No | append | append เพิ่มลงในรายการที่มีอยู่; replace ล้างรายการที่มีอยู่ก่อน |
| label | string | No | — | ป้ายกำกับที่มนุษย์อ่านได้สำหรับชุดข้อมู ล |
ระบุเป้าหมายผ่าน entries หรือ raw_text รายการซ้ำและว่างจะถูกละเว้น การนำเข้าครั้งเดียวมีขีดจำกัด 100,000 รายการ
ตัวอย่าง
curl -X POST http://localhost:50809/api/v1/super-marketing/dataset \
-H "Content-Type: application/json" \
-d '{
"data_type": "usernames",
"strategy": "shared_pool",
"label": "Campaign A targets",
"entries": ["@user_one", "@user_two", "@user_three"]
}'
ต่อท้ายเป้าหมายเพิ่มเติมลงในชุดข้อมูลที่มีอยู่:
curl -X POST http://localhost:50809/api/v1/super-marketing/dataset \
-H "Content-Type: application/json" \
-d '{
"dataset_id": 7,
"data_type": "usernames",
"strategy": "shared_pool",
"mode": "append",
"raw_text": "@user_four\n@user_five\n@user_six"
}'
ตัวอย่างการตอบสนอง
{
"code": 0,
"message": "success",
"data": {
"dataset": {
"stats": {
"id": 7,
"data_type": "usernames",
"strategy": "shared_pool",
"label": "Campaign A targets",
"total": 3,
"consumed": 0,
"remaining": 3,
"created_at": "2026-06-22 09:00:00",
"updated_at": "2026-06-22 09:00:00"
},
"entries": [
{ "id": 1, "value": "@user_one", "consumed": false, "consumed_by": null, "consumed_at": null, "created_at": "2026-06-22 09:00:00", "updated_at": "2026-06-22 09:00:00" }
]
},
"summary": {
"inserted": 3,
"duplicates": 0,
"skipped_empty": 0,
"removed": 0,
"truncated": 0
}
}
}
แสดงรายการชุดข้อมูล
ดึงชุดข้อมูลทั้งหมดพร้อมสถิติการใช้งาน
- Endpoint:
GET /api/v1/super-marketing/datasets
Query Parameters
| พารามิเตอร์ | ชนิด | ค่าเริ่มต้น | คำอธิบาย |
|---|---|---|---|
| data_type | string | — | ตัวกรองเสริม: usernames หรือ post_links |
ตัวอย่าง
curl "http://localhost:50809/api/v1/super-marketing/datasets?data_type=usernames"
ตัวอย่างการตอบสนอง
{
"code": 0,
"message": "success",
"data": [
{
"id": 7,
"data_type": "usernames",
"strategy": "shared_pool",
"label": "Campaign A targets",
"total": 6,
"consumed": 0,
"remaining": 6,
"created_at": "2026-06-22 09:00:00",
"updated_at": "2026-06-22 09:05:00"
}
]
}