Skip to main content

การกำหนดค่าสคริปต์ 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 — เป้าหมายถูก แบ่ง ระหว่างอุปกรณ์และแต่ละอันถูกใช้ครั้งเดียว

ขั้นตอนทั่วไป:

  1. นำเข้า เป้าหมายลงในชุดข้อมูล → รับ dataset_id
  2. รัน แคมเปญที่อ้างอิง 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_idintegerNoID ชุดข้อมูลที่มีอยู่สำหรับต่อท้าย/แทนที่ ละเว้นหรือใช้ 0 เพื่อสร้างชุดข้อมูลใหม่
data_typestringYesusernames หรือ post_links
strategystringYesshared_pool หรือ consume_once
entriesstring[]Yes*[]เป้าหมายเป็น JSON array มีความสำคัญเหนือ raw_text
raw_textstringYes*เป้าหมายเป็นสตริงคั่นด้วยบรรทัดใหม่ (ทางเลือกแทน entries)
modestringNoappendappend เพิ่มลงในรายการที่มีอยู่; replace ล้างรายการที่มีอยู่ก่อน
labelstringNoป้ายกำกับที่มนุษย์อ่านได้สำหรับชุดข้อมูล
note

ระบุเป้าหมายผ่าน 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_typestringตัวกรองเสริม: 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"
}
]
}

ดึงข้อมูลชุดข้อมูล

ดึงสถิติชุดข้อมูลและหน้ารายการ

  • Endpoint: GET /api/v1/super-marketing/dataset/{id}

Query Parameters

พารามิเตอร์ชนิดค่าเริ่มต้นคำอธิบาย
limitinteger50รายการต่อหน้า (สูงสุด 500)
offsetinteger0จำนวนรายการที่ข้าม

ตัวอย่าง

curl "http://localhost:50809/api/v1/super-marketing/dataset/7?limit=100&offset=0"

ล้างชุดข้อมูล

ลบ รายการทั้งหมด ออกจากชุดข้อมูล บันทึกชุดข้อมูลยังคงอยู่ (และ dataset_id ยังใช้ได้สำหรับการนำเข้าในอนาคต)

  • Endpoint: DELETE /api/v1/super-marketing/dataset/{id}

ตัวอย่าง

curl -X DELETE http://localhost:50809/api/v1/super-marketing/dataset/7

ตัวอย่างการตอบสนอง

{
"code": 0,
"message": "success",
"data": { "cleared": true, "dataset_id": 7 }
}

รันแคมเปญ

เปิดตัวแคมเปญ Super Marketing บนอุปกรณ์ที่กำหนด โดยใช้เป้าหมายจากชุดข้อมูล

  • Endpoint: POST /api/v1/super-marketing/run

Request Body

ฟิลด์ชนิดจำเป็นค่าเริ่มต้นคำอธิบาย
serialsstring[]Yes[]หมายเลขซีเรียลอุปกรณ์ที่จะรัน
dataset_idintegerYesชุดข้อมูลที่เป้าหมายขับเคลื่อนแคมเปญ
enable_multi_accountbooleanNofalseสร้างงานหนึ่งต่อบัญชีในแต่ละอุปกรณ์
merge_same_username_tasksbooleanNofalseรวมเป้าหมายทั้งหมดของอุปกรณ์เป็นงานเดียวแทนที่จะเป็นหนึ่งงานต่อเป้าหมาย
platformstringNoแทนที่แพลตฟอร์ม (tiktok / instagram)
min_intervalintegerNo0นาทีขั้นต่ำระหว่างเวลาเริ่มต้นงานที่สลับกัน
max_intervalintegerNo0นาทีสูงสุดระหว่างเวลาเริ่มต้นงานที่สลับกัน
start_timestringNoเวลาเริ่มต้นงานแรกในรูปแบบ HH:MM
rotate_proxybooleanNofalseหมุนเวียน proxy ของอุปกรณ์ก่อนรัน
switch_account_methodstringNoวิธีสลับบัญชีในโหมดหลายบัญชี
official_packagesstring[]No[]จำกัดการดำเนินการเฉพาะแพ็กเกจทางการเหล่านี้
clone_package_prefixstringNoจำกัดการดำเนินการเฉพาะแอปโคลนที่ชื่อแพ็กเกจเริ่มต้นด้วยคำนำหน้านี้
script_configobjectNoการสลับฟีเจอร์/การตั้งค่าต่อฟีเจอร์ที่แทนที่การกำหนดค่าที่บันทึกไว้ในเดสก์ท็อป
ประเภทข้อมูลมาจากชุดข้อมูล

คุณไม่ต้องส่ง data_source_type ในคำขอรัน — แคมเปญใช้ data_type ของชุดข้อมูลโดยอัตโนมัติ (usernames หรือ post_links) ชุดข้อมูล Post-link รองรับเฉพาะฟีเจอร์ boost_posts และ mass_comment

การแทนที่ script_config

script_config เป็น ตัวเลือก เมื่อละเว้น แคมเปญใช้การสลับฟีเจอร์และการตั้งค่าที่กำหนดไว้ในแอปเดสก์ท็อป ระบุเพื่อรันแคมเปญแบบครบในตัวเองหรือแทนที่ฟิลด์เฉพาะ คีย์รองรับทั้ง camelCase และ snake_case

ฟิลด์ชนิดคำอธิบาย
access_methodstringวิธีเข้าถึงเป้าหมาย username: search หรือ direct
features.follow_usersbooleanติดตามแต่ละเป้าหมาย
features.unfollow_usersbooleanเลิกติดตามแต่ละเป้าหมาย
features.report_accountbooleanรายงานบัญชีเป้าหมายแต่ละบัญชี
features.send_dmbooleanส่งข้อความโดยตรงถึงแต่ละเป้าหมาย
features.boost_postsbooleanไลค์/บันทึก/รีโพสต์/แชร์โพสต์ของเป้าหมาย
features.mass_commentbooleanคอมเมนต์โพสต์ของเป้าหมาย
follow_settings.boost_typestringfollow หรือ unfollow
dm_settings.message_contentsstringข้อความ DM (คั่นด้วยบรรทัดใหม่สำหรับหลายตัวแปร)
dm_settings.message_orderstringrandom หรือ sequential
dm_settings.insert_emojibooleanแทรก emoji แบบสุ่มใน DM
dm_settings.generate_by_chatgptbooleanสร้าง DM ด้วย ChatGPT
dm_settings.chatgpt_settingsobject{ url, api_key, model, system_prompt }
post_settings.skip_posts_countintegerโพสต์ที่ข้ามก่อนดำเนินการ (0–8 เฉพาะ username)
post_settings.max_posts_countintegerโพสต์สูงสุดที่จัดการต่อเป้าหมาย
post_settings.enable_likebooleanไลค์โพสต์
post_settings.enable_favoritebooleanเพิ่มโพสต์ไปยังรายการโปรด
post_settings.enable_repostbooleanรีโพสต์โพสต์
post_settings.enable_sharebooleanแชร์โพสต์
post_settings.repeat_timesintegerจำนวนครั้งที่ทำซ้ำการดำเนินการโพสต์
post_settings.view_durationsinteger[][min, max] วินาทีที่ดูแต่ละโพสต์
comment_settings.comment_contentstringข้อความคอมเมนต์ (คั่นด้วยบรรทัดใหม่สำหรับหลายตัวแปร)
comment_settings.comment_orderstringrandom หรือ sequential
comment_settings.insert_emojibooleanแทรก emoji แบบสุ่มในคอมเมนต์
comment_settings.generate_by_chatgptbooleanสร้างคอมเมนต์ด้วย ChatGPT
comment_settings.chatgpt_settingsobject{ url, api_key, model, system_prompt }
task_finish_wait_timeintegerวินาทีรอก่อนเสร็จสิ้น (ป้องกันข้อมูลสูญหาย)

ตัวอย่าง

รันขั้นต่ำ (ใช้การตั้งค่าที่บันทึกในเดสก์ท็อป)

curl -X POST http://localhost:50809/api/v1/super-marketing/run \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1", "device_serial_2"],
"dataset_id": 7
}'

แคมเปญติดตาม + DM แบบครบในตัวเอง

curl -X POST http://localhost:50809/api/v1/super-marketing/run \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"dataset_id": 7,
"enable_multi_account": true,
"min_interval": 1,
"max_interval": 3,
"script_config": {
"access_method": "search",
"features": {
"follow_users": true,
"send_dm": true
},
"follow_settings": { "boost_type": "follow" },
"dm_settings": {
"message_contents": "Hey! Love your content 🙌\nGreat posts, keep it up!",
"message_order": "random",
"insert_emoji": true
}
}
}'

คอมเมนต์จำนวนมากบนชุดข้อมูล post-link

curl -X POST http://localhost:50809/api/v1/super-marketing/run \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"dataset_id": 9,
"merge_same_username_tasks": true,
"script_config": {
"features": { "mass_comment": true },
"comment_settings": {
"comment_content": "🔥🔥🔥\nAmazing!\nLove this",
"comment_order": "random"
}
}
}'

ตัวอย่างการตอบสนอง

{
"code": 0,
"message": "success",
"data": { "created_count": 6 }
}

created_count คือจำนวนงานที่สร้าง งานที่รอดำเนินการจะรันบนอุปกรณ์ที่กำหนดเหมือนงานอื่น ๆ — ติดตามผ่าน Task Management API


การตอบสนองข้อผิดพลาด

HTTP StatusCodeคำอธิบาย
40040001พารามิเตอร์ไม่ถูกต้อง
40340301ถูกปฏิเสธ — ต้องใช้แผน Pro+
40440401ไม่พบชุดข้อมูล
50050001ข้อผิดพลาดภายในเซิร์ฟเวอร์
ไม่มีงานที่สร้าง

หากการรันส่งคืนรหัส 40001 พร้อมข้อความ "No tasks created" ตรวจสอบว่าชุดข้อมูลยังมีเป้าหมายที่เหลืออยู่ (สำหรับกลยุทธ์ consume_once) และอุปกรณ์ที่เลือกออนไลน์

ดูเพิ่มเติม