{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/ja/develop/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Webhook","description":"YouCam API documentation by Perfect Corp. Learn how to use Skin analysis API, Virtual try-on API, Image editing API, and Video generative AI APIs.","siteUrl":"https://docs.perfectcorp.com","keywords":"AI Skin Analysis, AI Clothes, AI Hairstyle, AI Outfits","image":"/assets/favicon.cd6fa4d833b2a573b3c6dae68386b293da205b203402cb0c97b80bd2acc07ea2.8351e24f.png"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"webhook","__idx":0},"children":["Webhook"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Webhook を使用すると、AI タスクが ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["success"]}," または ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error"]}," ステータスで完了したときに、アプリケーションが非同期通知を受信できます。通知はあなたが管理する HTTP エンドポイントに送信され、",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/standard-webhooks/standard-webhooks/blob/main/spec/standard-webhooks.md"},"children":["Standard Webhooks Specification"]}," に準拠しています。"]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"webhook-シークレット","__idx":1},"children":["Webhook シークレット"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":5,"id":"webhook-シークレットの構築","__idx":2},"children":["Webhook シークレットの構築"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["HMAC-SHA256"]}," 署名方式の Webhook シークレットを使用しています。Webhook シークレットは base64 エンコードされ、識別しやすいよう ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["whsec_"]}," がプレフィックスとして付与されています。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Webhook シークレットの例:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["whsec_NDQzMzYxNzkzMzE0NjYyNDM6OTIxOTcwNDIxODQ"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":5,"id":"standard-webhooks-ライブラリでの-webhook-実装","__idx":3},"children":["Standard Webhooks ライブラリでの Webhook 実装"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Standard Webhooks Library"]}," の公式実装の使用を推奨します。署名検証の詳細を気にする必要はありません。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["公式実装を使用することで、安全かつ正確な署名検証が保証されます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/standard-webhooks/standard-webhooks/tree/main?tab=readme-ov-file#reference-implementations"},"children":["https://github.com/standard-webhooks/standard-webhooks/tree/main?tab=readme-ov-file#reference-implementations"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":5,"id":"自分で-webhook-を実装する","__idx":4},"children":["自分で Webhook を実装する"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Webhook シークレットの仕組みを理解してください。",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/standard-webhooks/standard-webhooks/blob/main/spec/standard-webhooks.md#signature-scheme"},"children":["Signature scheme"]}," の Symmetric 部分を参照してください。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["署名入力を署名する際は、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["whsec_"]}," プレフィックスを除去し、残りの文字列を base64 デコードしてシークレットの実際のバイトを取得してから、",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["HMAC-SHA256"]}," ハッシュを実行します。"]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"webhook-リクエスト例","__idx":5},"children":["Webhook リクエスト例"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"http","header":{"controls":{"copy":{}}},"source":"POST https://yourdomain.com/webhook-endpoint\nContent-Type: application/json\nwebhook-id: msg_1eWPv9cWJCnEP99UJncmVJ6KjK_xVXRhZPe_eSGnRNbLlXEPjiG3gb3Usg9le3_4:1761112848\nwebhook-timestamp: 1761112900\nwebhook-signature: v1,vyVNWrjoZcBK1JXrFGkdDKK2slo5+Q5yfzpkHmqO5R0=\n","lang":"http"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"created_at\": 1761112848,\n  \"data\": {\n    \"task_id\": \"1eWPv9cWJCnEP99UJncmVJ6KjK_xVXRhZPe_eSGnRNbLlXEPjiG3gb3Usg9le3_4\",\n    \"task_status\": \"success\"\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"http-ヘッダー","__idx":6},"children":["HTTP ヘッダー"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":5,"id":"webhook-id","__idx":7},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["webhook-id"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Webhook 配信の一意な識別子です。"," ","この値はリトライ間で一貫しており、冪等性処理に使用すべきです。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":5,"id":"webhook-timestamp","__idx":8},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["webhook-timestamp"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Webhook が送信されたときの Unix エポックタイムスタンプ（秒）です。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":5,"id":"webhook-signature","__idx":9},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["webhook-signature"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["'v1' の後にカンマ (,) が続き、その後に base64 エンコードされた ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["HMAC-SHA256"]}," 署名が続きます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["'v1' は署名方式のバージョンを示し、現在サポートされている唯一のバージョンです。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["base64 エンコードされた ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["HMAC-SHA256"]}," 署名は、Webhook シークレットを使用して署名入力を署名した結果です。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["署名入力形式:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"{webhook-id}.{webhook-timestamp}.{raw-minified-json-body}\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["署名済みコンテンツの例:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"msg_1eWPv9cWJCnEP99UJncmVJ6KjK_xVXRhZPe_eSGnRNbLlXEPjiG3gb3Usg9le3_4:1761112848.1761112900.{\"created_at\":1761112848,\"data\":{\"task_id\":\"1eWPv9cWJCnEP99UJncmVJ6KjK_xVXRhZPe_eSGnRNbLlXEPjiG3gb3Usg9le3_4\",\"task_status\":\"success\"}}\n"},"children":[]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"リクエストボディ","__idx":10},"children":["リクエストボディ"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":5,"id":"created_at","__idx":11},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["created_at"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["タスクが完了した時刻を示す Unix エポックタイムスタンプ（秒）です。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":5,"id":"data","__idx":12},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["イベントペイロードを含みます。"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"フィールド"},"children":["フィールド"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"説明"},"children":["説明"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["task_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["タスク作成時に返されたタスク識別子です。この ID を使用して最終的なタスク結果をクエリできます。"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["task_status"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["タスク完了ステータス。可能な値: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["success"]},"、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error"]},"。"]}]}]}]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"統合ガイド","__idx":13},"children":["統合ガイド"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"webhook-統合ガイド","__idx":14},"children":["Webhook 統合ガイド"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["サーバーに Webhook エンドポイントを準備する。"]}," ","エンドポイントが ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST"]}," リクエストを受け入れ、HTTPS 経由でアクセス可能であることを確認してください。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["API Console で Webhook を作成する。"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["AI タスクを実行し、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["task_id"]}," を記録する。"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Webhook 通知を処理し、",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["task_id"]}," を使用してタスク結果を取得する。"]}]}]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"webhook-エンドポイントの作成","__idx":15},"children":["Webhook エンドポイントの作成"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["API Console の Webhook 管理ページにアクセスします:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://yce.makeupar.com/api-console/en/webhook/"},"children":["https://yce.makeupar.com/api-console/en/webhook/"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":5,"id":"1-webhook-セクションを見つける","__idx":16},"children":["1. Webhook セクションを見つける"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"https://bcw-media.s3.ap-northeast-1.amazonaws.com/strapi/assets/webhook_main_bae171663b.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":5,"id":"2-新しい-webhook-エンドポイントを作成する","__idx":17},"children":["2. 新しい Webhook エンドポイントを作成する"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"https://bcw-media.s3.ap-northeast-1.amazonaws.com/strapi/assets/webhook_create_cd28e68fa3.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["最大 ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["10 の Webhook エンドポイント"]}," を同時に設定できます。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":5,"id":"3-webhook-シークレットを保護する","__idx":18},"children":["3. Webhook シークレットを保護する"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Webhook シークレットは ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["webhook-signature"]}," の検証に使用されます。"," ","安全に保管し、公開しないでください。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"https://bcw-media.s3.ap-northeast-1.amazonaws.com/strapi/assets/webhook_secret_key_6fe757a7de.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":5,"id":"4-既存の-webhook-を管理する","__idx":19},"children":["4. 既存の Webhook を管理する"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"https://bcw-media.s3.ap-northeast-1.amazonaws.com/strapi/assets/webhook_manage_endpoints_3bed715de9.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"署名の検証","__idx":20},"children":["署名の検証"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"サーバーでの-webhook-リクエストの処理","__idx":21},"children":["サーバーでの Webhook リクエストの処理"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Standard Webhooks Library"]}," の公式実装の使用を推奨します:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://github.com/standard-webhooks/standard-webhooks/tree/main?tab=readme-ov-file#reference-implementations"},"children":["https://github.com/standard-webhooks/standard-webhooks/tree/main?tab=readme-ov-file#reference-implementations"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["これにより、安全かつ正確な署名検証が保証されます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Standard Webhooks Simulator"]}," を使用してペイロードのテストやデバッグもできます:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://www.standardwebhooks.com/simulate"},"children":["https://www.standardwebhooks.com/simulate"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"webhook-署名の検証","__idx":22},"children":["Webhook 署名の検証"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Webhook リクエスト例を検討します:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"http","header":{"controls":{"copy":{}}},"source":"POST https://yourdomain.com/webhook-endpoint\nContent-Type: application/json\nwebhook-id: msg_1eWPv9cWJCnEP99UJncmVJ6KjK_xVXRhZPe_eSGnRNbLlXEPjiG3gb3Usg9le3_4:1761112848\nwebhook-timestamp: 1761112900\nwebhook-signature: v1,vyVNWrjoZcBK1JXrFGkdDKK2slo5+Q5yfzpkHmqO5R0=\n","lang":"http"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["リクエストボディ:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"created_at\": 1761112848,\n  \"data\": {\n    \"task_id\": \"1eWPv9cWJCnEP99UJncmVJ6KjK_xVXRhZPe_eSGnRNbLlXEPjiG3gb3Usg9le3_4\",\n    \"task_status\": \"success\"\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["署名入力形式は次のようになります:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"{webhook-id}.{webhook-timestamp}.{raw-minified-json-body}\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["署名済みコンテンツの例:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"msg_1eWPv9cWJCnEP99UJncmVJ6KjK_xVXRhZPe_eSGnRNbLlXEPjiG3gb3Usg9le3_4:1761112848.1761112900.{\"created_at\":1761112848,\"data\":{\"task_id\":\"1eWPv9cWJCnEP99UJncmVJ6KjK_xVXRhZPe_eSGnRNbLlXEPjiG3gb3Usg9le3_4\",\"task_status\":\"success\"}}\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["受信した webhook-signature を使用して、Webhook シークレットキーで HMAC-SHA256 暗号化された署名済みコンテンツを検証します。"," ","例:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"v1,vyVNWrjoZcBK1JXrFGkdDKK2slo5+Q5yfzpkHmqO5R0=\n"},"children":[]}]},"headings":[{"value":"Webhook","id":"webhook","depth":1},{"value":"Webhook シークレット","id":"webhook-シークレット","depth":4},{"value":"Webhook シークレットの構築","id":"webhook-シークレットの構築","depth":5},{"value":"Standard Webhooks ライブラリでの Webhook 実装","id":"standard-webhooks-ライブラリでの-webhook-実装","depth":5},{"value":"自分で Webhook を実装する","id":"自分で-webhook-を実装する","depth":5},{"value":"Webhook リクエスト例","id":"webhook-リクエスト例","depth":4},{"value":"HTTP ヘッダー","id":"http-ヘッダー","depth":4},{"value":"webhook-id","id":"webhook-id","depth":5},{"value":"webhook-timestamp","id":"webhook-timestamp","depth":5},{"value":"webhook-signature","id":"webhook-signature","depth":5},{"value":"リクエストボディ","id":"リクエストボディ","depth":4},{"value":"created_at","id":"created_at","depth":5},{"value":"data","id":"data","depth":5},{"value":"統合ガイド","id":"統合ガイド","depth":2},{"value":"Webhook 統合ガイド","id":"webhook-統合ガイド","depth":3},{"value":"Webhook エンドポイントの作成","id":"webhook-エンドポイントの作成","depth":4},{"value":"1. Webhook セクションを見つける","id":"1-webhook-セクションを見つける","depth":5},{"value":"2. 新しい Webhook エンドポイントを作成する","id":"2-新しい-webhook-エンドポイントを作成する","depth":5},{"value":"3. Webhook シークレットを保護する","id":"3-webhook-シークレットを保護する","depth":5},{"value":"4. 既存の Webhook を管理する","id":"4-既存の-webhook-を管理する","depth":5},{"value":"署名の検証","id":"署名の検証","depth":2},{"value":"サーバーでの Webhook リクエストの処理","id":"サーバーでの-webhook-リクエストの処理","depth":4},{"value":"Webhook 署名の検証","id":"webhook-署名の検証","depth":4}],"frontmatter":{"seo":{"title":"Webhook"}},"lastModified":"2026-09-18T12:18:36.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ja/develop/webhook","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}