Chuyển tới nội dung chính

Cấu hình Script Super Marketing

Trang này ghi lại các API endpoint cho script Super Marketing. Khác với các script khác, super marketing không được tạo qua endpoint POST /api/v1/task chung — nó chạy dựa trên tập dữ liệu mục tiêu có thể tái sử dụng và có các endpoint riêng.

Tổng quan

Một chiến dịch super marketing kết hợp nhiều hành động tăng trưởng (theo dõi, bỏ theo dõi, báo cáo, DM, boost, bình luận hàng loạt) trên một nhóm mục tiêu. Nhóm mục tiêu được lưu dưới dạng tập dữ liệu:

  • Data type — tập dữ liệu chứa usernames (tên người dùng TikTok/Instagram) hoặc post_links (URL bài đăng).
  • Strategy — kiểm soát cách phân phối mục tiêu trên các thiết bị:
    • shared_pool — mỗi thiết bị/tài khoản xử lý tất cả mục tiêu.
    • consume_once — mục tiêu được chia trên các thiết bị, mỗi mục tiêu chỉ được xử lý một lần.

Quy trình điển hình:

  1. Nhập mục tiêu vào tập dữ liệu → nhận dataset_id.
  2. Chạy chiến dịch tham chiếu dataset_id đó trên một hoặc nhiều thiết bị.

Các tính năng bật/tắt và cài đặt chi tiết được đọc từ cấu hình đã lưu trong ứng dụng desktop (super_marketing_settings.json). Bạn có thể ghi đè bất kỳ cài đặt nào bằng cách truyền script_config trong yêu cầu chạy.

Yêu cầu giấy phép

Tất cả endpoint super marketing yêu cầu gói Pro, Team, hoặc Business.


Nhập Tập dữ liệu

Tạo tập dữ liệu mới hoặc thêm mục tiêu vào tập dữ liệu hiện có.

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

Request Body

FieldTypeRequiredDefaultDescription
dataset_idintegerNoID tập dữ liệu hiện có để thêm vào / thay thế. Bỏ qua hoặc dùng 0 để tạo mới.
data_typestringYesusernames hoặc post_links
strategystringYesshared_pool hoặc consume_once
entriesstring[]Yes*[]Mục tiêu dưới dạng JSON array. Ưu tiên hơn raw_text.
raw_textstringYes*Mục tiêu phân cách bằng dòng mới (thay thế cho entries).
modestringNoappendappend thêm vào hiện có; replace xóa hiện có trước.
labelstringNoNhãn tùy chọn cho tập dữ liệu.
ghi chú

Cung cấp mục tiêu qua entries hoặc raw_text. Mục nhập trùng lặp và rỗng bị bỏ qua. Một lần nhập tối đa 100,000 mục.

Ví dụ

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"]
}'

Thêm mục tiêu vào tập dữ liệu hiện có bằng văn bản phân cách dòng mới:

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"
}'

Phản hồi mẫu

{
"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
}
}
}

Liệt kê Tập dữ liệu

Lấy tất cả tập dữ liệu với thống kê tiêu thụ.

  • Endpoint: GET /api/v1/super-marketing/datasets

Query Parameters

ParameterTypeDefaultDescription
data_typestringBộ lọc tùy chọn: usernames hoặc post_links

Ví dụ

curl "http://localhost:50809/api/v1/super-marketing/datasets?data_type=usernames"

Phản hồi mẫu

{
"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"
}
]
}

Lấy Tập dữ liệu

Lấy thống kê và một trang mục của tập dữ liệu.

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

Query Parameters

ParameterTypeDefaultDescription
limitinteger50Mục mỗi trang (tối đa 500)
offsetinteger0Số mục bỏ qua

Ví dụ

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

Xóa Tập dữ liệu

Xóa tất cả mục khỏi tập dữ liệu. Bản ghi tập dữ liệu vẫn được giữ lại.

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

Ví dụ

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

Phản hồi mẫu

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

Chạy Chiến dịch

Khởi chạy chiến dịch super marketing trên các thiết bị đã cho, sử dụng mục tiêu từ tập dữ liệu.

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

Request Body

FieldTypeRequiredDefaultDescription
serialsstring[]Yes[]Số serial thiết bị để chạy
dataset_idintegerYesTập dữ liệu chứa mục tiêu cho chiến dịch
enable_multi_accountbooleanNofalseTạo một tác vụ mỗi tài khoản trên mỗi thiết bị
merge_same_username_tasksbooleanNofalseGom tất cả mục tiêu của thiết bị vào một tác vụ
platformstringNoGhi đè nền tảng (tiktok / instagram)
min_intervalintegerNo0Số phút tối thiểu giữa các thời gian bắt đầu tác vụ
max_intervalintegerNo0Số phút tối đa giữa các thời gian bắt đầu tác vụ
start_timestringNoThời gian bắt đầu tác vụ đầu tiên theo định dạng HH:MM
rotate_proxybooleanNofalseXoay proxy thiết bị trước khi chạy
switch_account_methodstringNoCách chuyển tài khoản trong chế độ đa tài khoản
official_packagesstring[]No[]Giới hạn chỉ các gói chính thức này
clone_package_prefixstringNoGiới hạn ứng dụng clone có tên gói bắt đầu bằng tiền tố này
script_configobjectNoTùy chọn tính năng / cài đặt ghi đè cấu hình lưu trên desktop (xem bên dưới)
Loại dữ liệu lấy từ tập dữ liệu

Không truyền data_source_type trong yêu cầu chạy — chiến dịch tự động sử dụng data_type của tập dữ liệu.

Ghi đè script_config

script_configtùy chọn. Khi bỏ qua, chiến dịch dùng cài đặt từ ứng dụng desktop. Các key chấp nhận cả camelCasesnake_case.

FieldTypeDescription
access_methodstringCách tiếp cận mục tiêu username: search hoặc direct
features.follow_usersbooleanTheo dõi mỗi mục tiêu
features.unfollow_usersbooleanBỏ theo dõi mỗi mục tiêu
features.report_accountbooleanBáo cáo mỗi tài khoản mục tiêu
features.send_dmbooleanGửi tin nhắn trực tiếp đến mỗi mục tiêu
features.boost_postsbooleanThích / yêu thích / đăng lại / chia sẻ bài đăng của mục tiêu
features.mass_commentbooleanBình luận bài đăng của mục tiêu
follow_settings.boost_typestringfollow hoặc unfollow
dm_settings.message_contentsstringNội dung DM (nhiều biến thể phân cách bằng dòng mới)
dm_settings.message_orderstringrandom hoặc sequential
dm_settings.insert_emojibooleanChèn emoji ngẫu nhiên vào DM
dm_settings.generate_by_chatgptbooleanTạo DM bằng ChatGPT
dm_settings.chatgpt_settingsobject{ url, api_key, model, system_prompt }
post_settings.skip_posts_countintegerSố bài đăng bỏ qua trước khi thao tác (0–8)
post_settings.max_posts_countintegerSố bài đăng tối đa xử lý mỗi mục tiêu
post_settings.enable_likebooleanThích bài đăng
post_settings.enable_favoritebooleanThêm bài đăng vào yêu thích
post_settings.enable_repostbooleanĐăng lại bài
post_settings.enable_sharebooleanChia sẻ bài đăng
post_settings.repeat_timesintegerSố lần lặp lại thao tác bài đăng
post_settings.view_durationsinteger[][min, max] giây xem mỗi bài đăng
comment_settings.comment_contentstringNội dung bình luận (nhiều biến thể phân cách bằng dòng mới)
comment_settings.comment_orderstringrandom hoặc sequential
comment_settings.insert_emojibooleanChèn emoji ngẫu nhiên vào bình luận
comment_settings.generate_by_chatgptbooleanTạo bình luận bằng ChatGPT
comment_settings.chatgpt_settingsobject{ url, api_key, model, system_prompt }
task_finish_wait_timeintegerGiây chờ trước khi hoàn thành

Ví dụ

Chạy tối giản (dùng cài đặt desktop)

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
}'

Chiến dịch theo dõi + DM tự đầy đủ

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
}
}
}'

Bình luận hàng loạt trên tập dữ liệu 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"
}
}
}'

Phản hồi mẫu

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

created_count là số tác vụ được tạo. Các tác vụ chờ sau đó chạy trên thiết bị được giao — theo dõi qua API Quản lý Tác vụ.


Phản hồi lỗi

HTTP StatusCodeDescription
40040001Tham số không hợp lệ (sai data_type/strategy, serials rỗng, dataset_id không hợp lệ, script_config không phải object, hoặc không có tác vụ nào được tạo)
40340301Forbidden — cần gói Pro+
40440401Không tìm thấy tập dữ liệu
50050001Lỗi nội bộ máy chủ
Không có tác vụ nào được tạo

Nếu lần chạy trả về mã 40001 với thông báo "No tasks created", hãy kiểm tra tập dữ liệu còn mục tiêu (với strategy consume_once) và các thiết bị được chọn đang trực tuyến.

Xem thêm