{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/ja/develop/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"デバッグガイド","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":"デバッグガイド","__idx":0},"children":["デバッグガイド"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["無効な TaskId エラー"]}," ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["理由:"]}," タスクが保持期間を超えると、それ以降のステータスチェックは InvalidTaskId エラーを返します。これを避けるには、AI タスクを開始した後に Webhook を設定するかポーリングを実装し、success または error のいずれかの終端状態に達するまでステータスを監視します。"," ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["解決策:"]}," タスクの有効期限切れを防ぐには、保持期間内に一定間隔でタスクステータスを確認するポーリングループを実装します。"," ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["AI API 使用時の 404 Not Found エラー"]}," ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["A:"]}," ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["重要"]}]},": File API を呼び出すだけではファイルはアップロードされません。File API のレスポンスで提供された URL にファイルをアップロードする必要があります。その URL がアップロード先です。続行する前に、ファイルがそこに正常に転送されたことを確認します。",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}," ","AI API を呼び出す前に、ファイルが正常にアップロードされたことを確認します。File API でアップロード URL を取得し、その場所へファイルをアップロードします。アップロードが完了すると、レスポンスで ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["file_id"]}]}," が返されます。この ID を使用して、そのファイルに関連する AI 機能にアクセスします。"," ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["API レスポンスが Postman で同じスタイル ID を返す"]}," ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["A:"]}," Postman（Pretty view）と Chrome が JavaScript で JSON レスポンスを解析するためです。JavaScript では、9007199254740991（2^53-1）を超える数は正確に表現できず、最も近い値に丸められるため、異なる ID が同一に見えることがあります（例: 219691778809271815 → 219691778809271800）。",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["JavaScript/JSON エラー処理における精度の損失",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["原因: JavaScript の Number 型は 2^53 - 1 を超える整数を安全に処理できないため、切り詰めまたは丸めが発生します。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["解決策: ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["json-bigint"]}]}," のような JSON パーサーを使用して ID を文字列として扱い、完全な精度を保持します。"," ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}]}]}]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Beard 認証 400 エラー"]}," ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["A:"]}," V2 API を使用する場合は、Bearer 認証ヘッダーを追加してすべてのリクエストに API キーを含めます。"," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["有効なリクエストヘッダー形式"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"Authorization: Bearer YOUR_API_KEY\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["よくある問題"]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Bearer プレフィックスの欠落"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization"]}," ヘッダーは ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Bearer"]}," で始まり、その後に API キーが続く必要があります。"," ","例:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"Authorization: YOUR_API_KEY\n"},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["不要な文字"]}," ","API キーの周りに角括弧 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["<"]}," や ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[">"]}," を含めません。これらの文字は不要で、リクエストが失敗します。"," ","例:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"Authorization: Bearer <YOUR_API_KEY>\n"},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["誤った API キー"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization"]}," ヘッダーの API キーが正しいことを確認します。"]}]}]}]}]}]},"headings":[{"value":"デバッグガイド","id":"デバッグガイド","depth":1}],"frontmatter":{"seo":{"title":"デバッグガイド"}},"lastModified":"2026-09-18T12:18:36.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ja/develop/debugging_guide","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}