# Taisly APIドキュメント - **OpenAPI Version:** `3.1.0` - **API Version:** `1.0.0` # Taisly APIドキュメント Taisly APIを使用すると、シンプルなAPIキー認証で複数のソーシャルメディアプラットフォームへの動画投稿とリポストを自動化できます。 ## 機能 - 複数のプラットフォームに同時に動画をアップロードして投稿 - あるプラットフォームから他のプラットフォームへの自動リポストを設定 - 後での投稿をスケジュール - 接続されたソーシャルメディアアカウントを管理 - 投稿履歴とステータスを追跡 ## 要件 - **プラン**: STARTER、INFLUENCER、またはPRO(FREEプランではAPIキーは利用不可) - **APIキー**: のダッシュボードで生成 - **HTTPS**: すべてのAPIリクエストはHTTPSを使用する必要があります ## レート制限 | プラン | 1時間あたりのリクエスト数 | | ---------- | ------------- | | STARTER | 50 | | INFLUENCER | 200 | | PRO | 1000 | レート制限を超えると、何秒待つべきかを示す`retryAfter`フィールドを含む429エラーを受け取ります。 ## セキュリティのベストプラクティス 1. APIキーをバージョン管理にコミットしないでください 2. キーは環境変数に保管してください 3. 漏洩した場合は直ちに再生成してください 4. HTTPSのみを使用してください ## 動画要件 - **フォーマット**: MP4、MOV、またはその他の一般的な動画フォーマット - **サイズ**: 最大500MB - **長さ**: 3-90秒 - **向き**: 9:16 ## クイックスタート例 ```bash # 1. 接続されたプラットフォームを取得 curl -X GET https://app.taisly.com/api/private/platform/platforms \ -H "Authorization: Bearer taisly_your_api_key_here" # 2. 動画をアップロード curl -X POST https://app.taisly.com/api/private/post \ -H "Authorization: Bearer taisly_your_api_key_here" \ -F "video=@/path/to/video.mp4" \ -F "platforms=[\"platform_id_1\"]" \ -F "description=Check out my new video!" # 3. 投稿履歴を確認 curl -X GET https://app.taisly.com/api/private/post/history \ -H "Authorization: Bearer taisly_your_api_key_here" ``` ## Python例 ```python import requests API_KEY = 'taisly_your_api_key_here' BASE_URL = 'https://app.taisly.com/api/private' headers = { 'Authorization': f'Bearer {API_KEY}' } # プラットフォームを取得 response = requests.get(f'{BASE_URL}/platform/platforms', headers=headers) platforms = response.json()['data'] print(f"接続されたプラットフォーム: {len(platforms)}") # 動画をアップロード files = {'video': open('video.mp4', 'rb')} data = { 'platforms': str([platforms[0]['_id']]), 'description': 'My video description' } response = requests.post(f'{BASE_URL}/post', headers=headers, files=files, data=data) print(response.json()) ``` ## Servers - **URL:** `https://app.taisly.com/api/private` - **Description:** 本番サーバー ## Operations ### APIキー情報を取得 - **Method:** `GET` - **Path:** `/user/api-key` - **Tags:** API Key Management 現在のAPIキーに関する情報を取得します。 #### Responses ##### Status: 200 ###### Content-Type: application/json ##### Status: 403 ###### Content-Type: application/json ##### Status: 500 ###### Content-Type: application/json ### APIキーを生成 - **Method:** `POST` - **Path:** `/user/api-key/generate` - **Tags:** API Key Management 新しいAPIキーを生成するか、既にある場合は再生成します。 **重要**: - APIキーは1回だけ表示されます。安全に保管してください。 - 再生成すると、以前のキーは直ちに無効になります。 #### Responses ##### Status: 200 ###### Content-Type: application/json ##### Status: 500 ###### Content-Type: application/json ### APIキー取り消し - **Method:** `POST` - **Path:** `/user/api-key/revoke` - **Tags:** API Key Management 現在のAPIキーを直ちに取り消します。このキーを使用するすべてのリクエストが失敗します。 #### Responses ##### Status: 200 ###### Content-Type: application/json ##### Status: 403 ###### Content-Type: application/json ##### Status: 500 ###### Content-Type: application/json ### 接続されたプラットフォームを取得 - **Method:** `GET` - **Path:** `/platform/platforms` - **Tags:** Platforms アカウントに接続されたすべてのソーシャルメディアアカウントを取得します。 #### Responses ##### Status: 200 ###### Content-Type: application/json ##### Status: 401 ###### Content-Type: application/json ##### Status: 403 ###### Content-Type: application/json ##### Status: 500 ###### Content-Type: application/json ### 投稿を作成 - **Method:** `POST` - **Path:** `/post` - **Tags:** Posts 動画を1つ以上の接続されたプラットフォームにアップロードします。 **動画要件:** - フォーマット: MP4、MOV、またはその他の一般的な動画フォーマット - サイズ: 最大500MB - 長さ: 3-90秒 - 向き: 縦向き (9:16) **スケジュール:** - スケジュール投稿の場合はミリ秒単位のUnixタイムスタンプを`scheduled`として渡してください(スケジュールしない場合はこのパラメータを省略) #### Request Body ##### Content-Type: multipart/form-data - **`platforms` (required)** `array` — IDリスト **Items:** `string` - **`video` (required)** `string`, format: `binary` — - **`description`** `string` - **`previewTime`** `number` — サムネイル生成用の秒単位タイムスタンプ(デフォルト: 0) - **`scheduled`** `string` **Example:** ```json { "video": {}, "platforms": [ "" ], "description": "", "previewTime": 1, "scheduled": "" } ``` #### Responses ##### Status: 200 ###### Content-Type: application/json ##### Status: 401 ###### Content-Type: application/json ##### Status: 403 ###### Content-Type: application/json ##### Status: 500 ###### Content-Type: application/json ### 投稿履歴を取得 - **Method:** `GET` - **Path:** `/post/history` - **Tags:** Posts 各プラットフォームのステータス情報を含む投稿履歴を取得します。 **ページネーション:** - ページネーションには`page`パラメータを使用(ページあたり10件) - 日付範囲フィルタリングには`startTime`と`endTime`を使用(一致するすべての投稿を返す) **ステータス値:** - PENDING: 投稿がキューにある - SUCCESS: 投稿成功 - FAILED: 投稿失敗(エラーメッセージはmessageフィールドを確認) #### Responses ##### Status: 200 ###### Content-Type: application/json ##### Status: 401 ###### Content-Type: application/json ##### Status: 500 ###### Content-Type: application/json ### スケジュール投稿をキャンセル - **Method:** `GET` - **Path:** `/post/cancelSchedule` - **Tags:** Posts 後でスケジュールされた投稿をキャンセルします。投稿は完全に削除されます。 #### Responses ##### Status: 200 ###### Content-Type: application/json ##### Status: 401 ###### Content-Type: application/json ##### Status: 500 ###### Content-Type: application/json ### リポスト設定を取得 - **Method:** `GET` - **Path:** `/reposts` - **Tags:** Reposts 設定されたすべての自動リポストルールを取得します。'from'プラットフォームに投稿すると、コンテンツは自動的にすべての'to'プラットフォームにリポストされます。 #### Responses ##### Status: 200 ###### Content-Type: application/json ##### Status: 401 ###### Content-Type: application/json ##### Status: 500 ###### Content-Type: application/json ### リポスト設定を追加 - **Method:** `POST` - **Path:** `/repost/add` - **Tags:** Reposts あるプラットフォームから他のプラットフォームへの自動リポストを設定します。 **仕組み:** - 'from'プラットフォームに投稿すると、自動的にすべての'to'プラットフォームにリポストされます **注意**: 循環依存関係が防止されます。 B→Aが既に存在する場合、A→Bを作成できません。 #### Request Body ##### Content-Type: application/json - **`from` (required)** `string` — プラットフォームID - **`to` (required)** `array` **Items:** `string` **Example:** ```json { "from": "", "to": [ "" ] } ``` #### Responses ##### Status: 200 ###### Content-Type: application/json ##### Status: 400 ###### Content-Type: application/json ##### Status: 401 ###### Content-Type: application/json ##### Status: 500 ###### Content-Type: application/json ### リポスト設定を削除 - **Method:** `POST` - **Path:** `/repost/delete` - **Tags:** Reposts 自動リポストルールを削除します。ソースプラットフォームへの今後の投稿は自動的にリポストされなくなります。 #### Request Body ##### Content-Type: application/json - **`id` (required)** `string` **Example:** ```json { "id": "" } ``` #### Responses ##### Status: 200 ###### Content-Type: application/json ##### Status: 401 ###### Content-Type: application/json ##### Status: 500 ###### Content-Type: application/json ### リポストを一時停止/再開 - **Method:** `POST` - **Path:** `/repost/pause` - **Tags:** Reposts 自動リポストを一時的に一時停止または再開します。設定を削除せずに一時的にリポストを停止したいときに便利です。 #### Request Body ##### Content-Type: application/json - **`id` (required)** `string` - **`isPaused` (required)** `boolean` **Example:** ```json { "id": "", "isPaused": true } ``` #### Responses ##### Status: 200 ###### Content-Type: application/json ##### Status: 401 ###### Content-Type: application/json ##### Status: 500 ###### Content-Type: application/json