投稿スクリプト設定
このページでは、タスク作成に使用される 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} |
| caption_format | string | いいえ | "multiline" | 複数行キャプションの処理方法:multiline(実際の改行を挿入)または singleline(\n をスペースに置換) |
| ai_label | boolean | いいえ | false | 投稿にAI生成コンテンツのラベルを追加するかどうか |
| save_draft | boolean | いいえ | false | すぐに公開する代わりに投稿を下書きとして保存する |
| post_way | string | いいえ | "addButton" | 投稿方法です。詳細は以下の 投稿方法 セクションを参照してください |
| 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 | いいえ | 10 | アップロード完了を待つ秒数 |
upload_wait_timeは通常投稿とsave_draftモードの両方に適用されます。下書きとして保存する場合でも、TikTok/Instagram がバックグラウンドで動画のアップロードを完了するまで待機時間が必要です。 | 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 | いいえ | 100 | オリジナルサウンドボリューム(0-100) | | add_sound_volume | integer | いいえ | 100 | 追加サウンドボリューム(0-100) |
投稿方法(post_way)
post_way パラメータは、スクリプトが投稿画面を開く方法を制御します。
| 値 | 説明 |
|---|---|
addButton | (デフォルト) アプリ内の「+」作成ボタンをタップし、その後デバイスのギャラリーからメディアを選択します。すべての投稿先(reel、story、post)で動作します。ほとんどのケースで推奨されます。 |
share | メディアファイルから Instagram/TikTok アプリへ Android の共有インテントを直接起動します。アプリ内ナビゲーションを回避する代替方法であり、特定の端末やアプリ版で addButton フローが不安定な場合に役立ちます。 |
useSound | 最初に特定の音源トラック(sound_name の URL またはキーワード経由)へ移動し、その音源に動画を紐付けます。Reels / TikTok のみ。 sound_name の設定が必要です。placement = "post" または placement = "story" とは互換性がありません。 |
placement が post(Instagram の通常フィード投稿)の場合、post_way に関係なくサウンド自動化はサポートされません。スクリプトはサウンド手順を自動的にスキップします。
TikTok 固有のパラメータ
| パラメータ | 型 | 必須 | デフォルト | 説明 |
|---|---|---|---|---|
| placement | string | いいえ | "" | 投稿先: "" (通常の動画、デフォルト) または "story" (TikTok Story)。"story" の場合、スクリプトはサウンド設定後に "Your Story" をクリックし、タイトル/商品リンク/AIラベルのステップをスキップします。 |
| add_product_link | integer | いいえ | 0 | 商品/ショッピングリンクを追加するかどうか:0 = いいえ、1 = はい |
Instagram 固有のパラメータ
| パラメータ | 型 | 必須 | デフォルト | 説明 |
|---|---|---|---|---|
| placement | string | いいえ | "reel" | 投稿先:reel(Reels)、story(Stories)、または post(通常のフィード投稿)。注: placement が post の場合、サウンドオプションはサポートされません |
| enable_schedule_reels | boolean | いいえ | false | Reel を将来の時間にスケジュールするかどうか |
| schedule_reels_time | string | 条件付き | "" | YYYY-MM-DD HH:MM 形式のスケジュール公開時間(enable_schedule_reels = true の場合必須) |
| story_link | string | いいえ | "" | Story にステッカーリンクとして添付する URL(placement = "story" の場合のみ適用) |
例
TikTok Story に投稿
TikTok Story に直接投稿します。サウンド設定後、スクリプトは "Your Story" をクリック — タイトル/商品リンク/AIラベルのステップなし :
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,
"placement": "story",
"post_way": "addButton",
"material_list": ["C:/Videos/story_video.mp4"],
"upload_wait_time": 30
}
}'
直接素材リストを使用した基本的な投稿タスク
これは 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
}'
Instagram フィード投稿 (placement: post)
通常の Instagram フィード(Reel ではない)に投稿します。この投稿先ではサウンドオプションはサポートされません。
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "post",
"platform": "instagram",
"script_config": {
"content_type": 0,
"captions": "New post! #instagram",
"placement": "post",
"post_way": "addButton",
"material_list": ["C:/Videos/my_video.mp4"],
"upload_wait_time": 45
}
}'
カスタムサウンドを使用した投稿
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
}
}'
特定のサウンド URL を使用した投稿
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "post",
"script_config": {
"post_way": "useSound",
"sound_name": "https://www.tiktok.com/music/original-sound-7123456789",
"captions": "この素晴らしいサウンドを使用!",
"material_source": "materialLibrary"
}
}'
画像投稿(カルーセル)
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": 1,
"image_count": 5,
"captions": "これらの写真をチェック!#フォトカルーセル",
"material_source": "localFolder",
"material_path": "C:/Images/carousel",
"upload_wait_time": 45
}
}'
明示的なプラットフォーム選択での投稿
platform パラメータを使用してターゲットプラットフォームを明示的に指定できます。これは環境のデフォルトをオーバーライドする場合に便利です:
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "post",
"platform": "instagram",
"script_config": {
"content_type": 0,
"captions": "Instagramに投稿! #instagram #reels",
"placement": "reel",
"material_list": [
"C:/Videos/instagram_video.mp4"
],
"upload_wait_time": 60
}
}'
レスポンス
{
"code": 0,
"message": "success",
"data": {
"task_ids": [101, 102],
"created_count": 2
}
}
関連項目
- タスク管理 API - タスクの作成、リスト、管理