Cấu hình Script Tin nhắn
Trang này ghi lại các tham số cấu hình của script message.
Tổng quan
Script message tự động gửi tin nhắn trực tiếp đến người dùng trên TikTok hoặc Instagram. Với nhiều người dùng mục tiêu qua API, một tác vụ được tạo cho mỗi người dùng. Kiểm soát thời gian bằng start_time.
Cấu hình Script (script_config)
Tham số cấu hình script tin nhắn:
Tham số
| Tham số | Kiểu | Bắt buộc | Mặc định | Mô tả |
|---|---|---|---|---|
| target_users | string[] | Yes* | [] | Mảng người dùng mục tiêu (một tác vụ mỗi người) |
| target_user | string | Yes* | "" | Tên người dùng đơn hoặc nhiều người phân cách bằng dòng mới/dấu phẩy |
| message_content | string | Yes | "" | Nội dung văn bản tin nhắn |
| access_method | string | No | "direct" | Phương thức truy cập: direct hoặc search |
ghi chú
Phải cung cấp mảng target_users hoặc chuỗi target_user. target_users được ưu tiên.
thông tin
Với nhiều người dùng mục tiêu, API tạo một tác vụ cho mỗi người. 3 người + 2 thiết bị = 6 tác vụ.
Ví dụ
Gửi tin nhắn đến một người
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "message",
"script_config": {
"target_users": ["@username_to_message"],
"message_content": "Hello! Check out our latest content.",
"access_method": "direct"
}
}'
Gửi tin nhắn đến nhiều người
Một tác vụ cho mỗi người:
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "message",
"script_config": {
"target_users": ["@user1", "@user2", "@user3"],
"message_content": "Hi! We have an exclusive offer for you."
}
}'
Tạo 3 tác vụ riêng biệt thực thi ngay lập tức.
Lên lịch tin nhắn với thời gian bắt đầu
Dùng start_time để lên lịch:
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "message",
"script_config": {
"target_users": ["@user1", "@user2"],
"message_content": "Scheduled greeting!"
},
"start_time": "14:30"
}'
Gửi tin nhắn qua phương thức tìm kiếm
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "message",
"script_config": {
"target_users": ["username1", "username2"],
"message_content": "Hello from TikMatrix!",
"access_method": "search"
}
}'
Gửi tin nhắn theo danh sách tên người dùng
Tạo tác vụ tin nhắn trực tiếp cho các tài khoản cụ thể:
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"usernames": ["@my_account1", "@my_account2"],
"script_name": "message",
"script_config": {
"target_users": ["@target_user"],
"message_content": "Hi there!"
}
}'
Gửi tin nhắn hàng loạt trên nhiều thiết bị
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_1", "device_2", "device_3"],
"script_name": "message",
"script_config": {
"target_users": ["@influencer_account"],
"message_content": "Love your content! Let's collaborate."
},
"enable_multi_account": true
}'
Ví dụ Instagram
API tương tự cho Instagram:
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "message",
"script_config": {
"target_user": "instagram_username",
"message_content": "Hey! Loved your post"
}
}'
Phản hồi
{
"code": 0,
"message": "success",
"data": {
"task_ids": [501, 502, 503],
"created_count": 3
}
}
Phương thức Truy cập
Phương thức trực tiếp (direct)
Mở hồ sơ người dùng qua URL. Nhanh hơn và đáng tin cậy hơn.