logo
Development
検索
ワークフローの連携

ワークフローの連携

GPTBotsのワークフローは連携のためのAPIとして機能します。

リクエストメソッド

POST

リクエストURL

https://api-{endpoint}.gptbots.ai/v1/workflow/invoke

リクエスト認証

認証方法の説明についてはAPI Overviewをご参照ください。

リクエスト

curl -X POST 'https://api-{endpoint}.gptbots.ai/v1/workflow/invoke' \ -H 'Authorization: Bearer ${API Key}' \ -H 'Content-Type: application/json' \ -d '{ "userId": "<your_user_id>", "input": { <your_start> } }'
                      
                      curl -X POST 'https://api-{endpoint}.gptbots.ai/v1/workflow/invoke' \
-H 'Authorization: Bearer ${API Key}' \
-H 'Content-Type: application/json' \
-d '{
    "userId": "<your_user_id>",
    "input": {
        <your_start>
    }
}'

                    
このコードブロックをポップアップで表示

リクエストパラメータ

フィールド タイプ 説明
Authorization Bearer ${API Key} 認証には Authorization: Bearer ${API Key} を使用してください。トークンはAPIキーページから取得できます。
Content-Type application/json データの形式は application/json を設定してください。

リクエストボディ

フィールド タイプ 必須 解説
userId String 任意 このリクエストを開始した人の識別子として機能します。
input Object 必須 ワークフローの Start ノードを表します。このフィールド内のパラメータは、ワークフローの Start ノードで指定されたパラメータと一致している必要があります。

レスポンス

レスポンス例

{ "workflowRunId": "xxxx-5b15-4cbf-999c-1b218934xxxx", "input": { "input": "What should I do after a breakup?" }, "output": { "output": "Breakups are a normal part of life. While it can be painful, it can also serve as an opportunity for growth and self-reflection. Here are some suggestions that might help you: \n\n..." }, "workflowExecutionTime": 24277, "status": "SUCCEED", "totalCost": 1.3754, "totalTokens": 3464, "startTime": 1741768313025, "endTime": 1741768337310 }
                      
                      {
    "workflowRunId": "xxxx-5b15-4cbf-999c-1b218934xxxx",
    "input": {
        "input": "What should I do after a breakup?"
    },
    "output": {
        "output": "Breakups are a normal part of life. While it can be painful, it can also serve as an opportunity for growth and self-reflection. Here are some suggestions that might help you: \n\n..."
    },
    "workflowExecutionTime": 24277,
    "status": "SUCCEED",
    "totalCost": 1.3754,
    "totalTokens": 3464,
    "startTime": 1741768313025,
    "endTime": 1741768337310
}

                    
このコードブロックをポップアップで表示

レスポンスボディ

フィールド タイプ 説明
workflowRunId String ワークフローの実行ID(この実行の一意な識別子)です。
input Object Startノードの入力内容です。リクエストの"input field"の内容と一致する必要があります。
output Object Endノードの出力内容です。ワークフローの実行結果もここに含まれます。
workflowExecutionTime Number ワークフローの実行時間(単位: ms)。
status String ワークフローの結果を表します。以下の値のいずれかになります:
SUCCEED:成功
FAILED:失敗
RUNNING:実行中
totalCost Number トータルのクレジット使用量(すべてのノードの使用量を合計);単位:クレジット。
totalTokens Number トータルのトークン使用量(すべてのノードの使用量を合計)
startTime Number アクション開始のタイムスタンプ(単位:ms)
endTime Number アクション終了のタイムスタンプ(単位:ms)