投稿スクリプト設定
このページでは、タスク作成に使用される post スクリプトの設定パラメータについて説明します。
概要
post スクリプトは、TikTok または Instagram にコンテンツ(動画または画像)を自動的に公開するために使用されます。さまざまな投稿方法、素材ソース、サウンドオプションをサポートしています。
リクエストパラメータ
タスク作成時に、以下のトップレベルパラメータを指定できます:
| パラメータ | 型 | 必須 | デフォルト | 説明 |
|---|---|---|---|---|
| serials | string[] | 条件付き | [] | デバイスシリアル番号のリスト(モード1:デバイスベース) |
| usernames | string[] | 条件付き | [] | タスクを作成するユーザー名のリスト(モード2:ユーザー名ベース) |
| script_name | string | はい | - | 実行するスクリプト名(例:「post」) |
| script_config | object | はい | - | スクリプト設定パラメータ(下記参照) |
| enable_multi_account | boolean | いいえ | false | マルチアカウントモードを有効化(デバイス上の各アカウントにタスクを作成) |
| start_time | string | いいえ | - | オプションの開始時刻("HH:MM"形式) |
| platform | string | 条件付き* | auto | ターゲットプラットフォーム:tiktok、instagram。下記の注意を参照 |
注意: serials または usernames のいずれかを提供する必要があります。
*Platform パラメータの動作:
- TikMatrix と IgMatrix:
platformパラメータが提供されても無視されます。プラットフォームはアプリ名から自動的に決定されます(TikMatrix → tiktok、IgMatrix → instagram)。 - TikMatrix Pro:
platformパラメータは必須であり、tiktokまたはinstagramとして明示的に指定する必要があります。
スクリプト設定 (script_config)
script_config オブジェクトには、投稿スクリプトのパラメータが含まれます。以下は利用可能なパラメータです:
共通パラメータ(TikTok と Instagram)
| パラメータ | 型 | 必須 | デフォルト | 説明 |
|---|---|---|---|---|
| content_type | integer | いいえ | 0 | コンテンツタイプ:0 = 動画、1 = 画像 |
| image_count | integer | いいえ | 1 | 選択する画像の数(content_type = 1 の場合) |
| captions | string | いいえ | "" | 投稿のキャプションテキスト。スピンタックス形式をサポート:{option1|option2|option3} |
| post_way | string | いいえ | "share" | 投稿方法:share、addButton、または useSound |
| material_source | string | いいえ | "materialLibrary" | 素材ソース:materialLibrary または localFolder(material_list が提供されている場合は無視) |
| material_path | string | 条件付き | "" | ローカルフォルダパス(material_source = "localFolder" の場合必須) |
| material_list | string[] | いいえ | [] | 直接素材ファイルパス配列。 提供された場合、material_source と material_path のロジックをバイパスします。API 自動化に最適。 |
| materials_tags | string | いいえ | "" | ライブラリからフィルタリングするためのカンマ区切りの素材タグ |
| upload_wait_time | integer | いいえ | 30 | アップロード完了を待つ秒数 |
| sound_wait_time | integer | いいえ | 10 | サウンド読み込みを待つ秒数 |
| add_sound | string/integer | いいえ | "-1" | サウンドオプション:-1 = デフォルト、0 = 無効、1 = 有効、custom = カスタムサウンドを使用 |
| sound_name | string | 条件付き | "" | サウンド名/URL(post_way = "useSound" の場合必須) |
| custom_sound_keyword | string | 条件付き | "" | カスタムサウンドを検索するキーワード(add_sound = "custom" の場合必須) |
| origin_sound_volume | integer | いいえ | 50 | オリジナルサウンドボリューム(0-100) |
| add_sound_volume | integer | いいえ | 50 | 追加サウンドボリューム(0-100) |
Instagram 固有のパラメータ
| パラメータ | 型 | 必須 | デフォルト | 説明 |
|---|---|---|---|---|
| placement | string | いいえ | "reel" | 投稿配置:reel または story |
例
直接素材リストを使用した基本的な投稿タスク
これは API 自動化の推奨アプローチです - 素材ライブラリやフォルダスキャンに依存せずに素材パスを直接渡します:
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "post",
"script_config": {
"content_type": 0,
"captions": "新しい動画をチェック!#バイラル #fyp",
"material_list": [
"C:/Videos/video1.mp4"
],
"upload_wait_time": 60
}
}'
素材ライブラリを使用した投稿タスク(TikTok)
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1", "device_serial_2"],
"script_name": "post",
"script_config": {
"content_type": 0,
"captions": "新しい動画をチェック!#バイラル #fyp",
"post_way": "addButton",
"material_source": "materialLibrary",
"materials_tags": "トレンド, ダンス",
"upload_wait_time": 60,
"add_sound": "-1"
},
"enable_multi_account": false
}'
ユーザー名リストによる投稿タスク
このモードでは、デバイスのシリアル番号を知らなくても、特定のアカウント用に直接タスクを作成できます:
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"usernames": ["@user1", "@user2", "@user3"],
"script_name": "post",
"script_config": {
"content_type": 0,
"captions": "新しい動画をチェック!#バイラル #fyp",
"material_list": [
"C:/Videos/video1.mp4"
],
"upload_wait_time": 60
}
}'
ローカルフォルダを使用した投稿タスク(Instagram)
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "post",
"script_config": {
"content_type": 0,
"captions": "素晴らしいコンテンツ!#instagram #reels",
"post_way": "addButton",
"placement": "reel",
"material_source": "localFolder",
"material_path": "C:/Videos/instagram",
"upload_wait_time": 45
},
"enable_multi_account": true
}'
カスタムサウンドを使用した投稿
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "post",
"script_config": {
"content_type": 0,
"captions": "このトレンドサウンドに合わせて踊る!",
"post_way": "addButton",
"add_sound": "custom",
"custom_sound_keyword": "トレンドダンス 2024",
"origin_sound_volume": 30,
"add_sound_volume": 70,
"material_source": "materialLibrary",
"upload_wait_time": 60
}
}'