{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/zh-TW/develop/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"FAQ","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":"faq","__idx":0},"children":["FAQ"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["問：「Unit（點數）」是什麼？如何使用？"]}," ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["答："]}," 請注意，Units 是 YouCam API 運作所用的計費單位；不同的 AI 功能會扣除不同數量的點數。在本文件中，Unit 的代號為「Credit」。"," ",{"$$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":["問：為什麼會出現 InvalidTaskId 錯誤？"]}," ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["答："]}," 當您查詢一個已逾時任務的狀態時，會收到 ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["InvalidTaskId"]}]}," 錯誤。因此，當您執行 AI 任務後，必須",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["輪詢"]},"，在 ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["polling_interval"]}]}," 內檢查狀態，直到狀態變成 ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["success"]}," 或 ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["error"]},"。"," ",{"$$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":["問：如何進行認證？"]}," ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["答："]}," 您的 API Key 就是完成認證程序所用的 ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Bearer Token"]}]},"。請使用 ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Bearer Token"]}," 在請求標頭中納入您的 API 金鑰："]},{"$$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":"MarkdownLink","attributes":{"href":"https://www.makeupar.com/consumer/blog"},"children":["部落格頁面"]},"與 ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://yce.makeupar.com/api-console/en/api-playground/ai-skin-analysis/"},"children":["API playground"]},"，或發送電子郵件至 ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"mailto:YouCamOnlineEditor_API@perfectcorp.com"},"children":["YouCamOnlineEditor_API@perfectcorp.com"]},"。我們的客戶成功團隊很樂意為您協助。;)"," ",{"$$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":["問：如何用 curl 上傳圖片？"]}," ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["答："]}," curl --location --request PUT '{url_api_response}' --header '{headers_in_api_response}' --data-binary @'{local_file_path}'"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"curl --location --request PUT 'https://example.com/sample-result-url' --header 'Content-Type: image/jpg' --header 'Content-Length: 50000'  --data-binary @'./test.jpg'\n"},"children":[]},{"$$mdtype":"Tag","name":"p","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 支援哪些平台？可以在行動裝置上使用嗎？"]}," ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["答："]}," AI API 可跨平台順暢運作。由於它建構於標準 RESTful API，您可以用於伺服器對伺服器（server-to-server）通訊、行動裝置，或網頁瀏覽器中，選擇最適合您需求的方式。"," ",{"$$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":["問：可以在 Android 與 iOS 上透過 Flutter 使用 AI API 嗎？"]}," ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["答："]}," ","完全可以。由於 AI API 是標準 RESTful API，您可以使用 Flutter 內建的 HTTP API 發送請求。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["以下是 Flutter 官方關於網路查詢的文件。"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["https://docs.flutter.dev/cookbook/networking/fetch-data"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["https://pub.dev/packages/http"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["以下是在 Flutter 中使用 http 套件，透過 Bearer 認證呼叫 http GET 的簡易方式："]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"dart","header":{"controls":{"copy":{}}},"source":"import 'dart:convert';\nimport 'package:http/http.dart' as http;\n\nFuture<void> fetchData() async {\n    String token = \"your_bearer_token_here\"; // 替換為您實際的 token\n\n    final response = await http.get(\n        Uri.parse(\"https://yce-api-01.makeupar.com/s2s/v2.0/task/ai-task\"), // 將 `ai-task` 替換為您要使用的 AI 功能。\n        headers: {\n        \"Content-Type\": \"application/json\",\n        \"Authorization\": \"Bearer $token\",\n        },\n    );\n\n    if (response.statusCode == 200) {\n        print(\"Data fetched successfully: ${response.body}\");\n    } else {\n        print(\"Failed to fetch data: ${response.statusCode}\");\n    }\n}\n","lang":"dart"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["認證的關鍵步驟："]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["取得 Token – 您可以使用 SharedPreferences 或其他安全儲存方式來儲存與取得 token。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["在標頭中納入 Token – 在請求標頭中使用 \"Authorization\": \"Bearer $token\"。"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["處理過期的 Token – 若 API 回傳 401 InvalidAccessToken 錯誤，請視需要刷新 token。"," ",{"$$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 key 就是 API key，那麼要到哪裡找到 secret key？"]}," ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["答："]}," secret key 只會在您第一次產生時建立。因此務必立即儲存，之後將無法再次查看。"," ",{"$$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":["問：可以透過 Wix 將 AI API 整合到您的網站嗎？"]}," ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["答："]}," 我們目前沒有 AI API 與 Wix 整合的官方指南。不過，RESTful API 本身對平台沒有任何限制，只要該平台支援標準的網頁查詢即可。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["我們強烈建議先閱讀 Wix 提供的官方文件：https://dev.wix.com/docs/develop-websites/articles/get-started/integrate-with-3rd-parties"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Wix 提供多種與第三方 API 整合的方法，主要透過其 Velo 開發平台："]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Fetch API："," ","這是最常見的方法，也是標準 JavaScript Fetch API 的實作。您可以從 Wix 網站的前端或後端程式碼，對外部 API 發送 HTTP 請求。"," ","後端呼叫：基於安全性建議（尤其是需要金鑰的 API），並為避免 CORS 問題，請使用後端呼叫。使用 Secrets Manager 安全儲存 API 金鑰。"," ","前端呼叫：可行，但安全性較低，且可能遇到 CORS 限制。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["npm 套件："," ","Velo 支援使用經核准的 npm 套件，讓您可以運用大量預先建置的 JavaScript 模組，以第三方功能擴充網站功能。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Service Plugins（舊稱 SPIs/Custom Extensions）："," ","這些插件可將自訂邏輯注入，或直接將第三方服務整合進 Wix 的商業解決方案（例如 Wix Stores、Wix Bookings）。Service plugins 讓您可以客製化既有應用流程的特定環節，或整合外部服務以實現自訂運費、動態定價、替代金流服務等功能。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["HTTP Functions："," ","您可以將網站功能以 API 形式對外開放，讓第三方服務呼叫您 Wix 網站的後端函式，與網站的資料或邏輯互動。"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["整合步驟（以 Fetch API 為例）："]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["儲存 API 金鑰：若第三方 API 需要認證，請將 API 金鑰等敏感憑證安全儲存於 Wix 的 Secrets Manager。"," ","匯入 wix-fetch：在您的 Velo 後端或前端程式碼中，匯入 wixFetch 模組。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"JavaScript","header":{"controls":{"copy":{}}},"source":"import { fetch } from 'wix-fetch';\n","lang":"JavaScript"},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["發送 API 呼叫：使用 fetch 函式向第三方 API 發送請求，包含必要的標頭與內容資料。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"JavaScript","header":{"controls":{"copy":{}}},"source":"export async function getWeatherData() {\n    const apiKey = await getSecret(\"yourApiKeyName\"); // 自 Secrets Manager 取得\n    const response = await fetch(`https://api.weatherapi.com/v1/current.json?key=${apiKey}&q=London`, {\n        method: 'GET',\n        headers: {\n            'Content-Type': 'application/json'\n        }\n    });\n    const data = await response.json();\n    return data;\n}\n","lang":"JavaScript"},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["處理回應：處理自 API 收到的資料，並整合到網站的設計或功能中。"," ",{"$$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 整合到 WooCommerce 嗎？"]}," ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["答："]}," 我們目前沒有 AI API 與 WooCommerce 整合的官方指南。不過，RESTful API 本身對平台沒有任何限制，只要該平台支援標準的網頁查詢即可。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["我們強烈建議先閱讀 WooCommerce 提供的官方文件：https://woocommerce.com/document/woocommerce-rest-api/"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["將第三方 API 與 WooCommerce 整合，可強化商店功能並簡化營運。可透過以下幾種方式達成："]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["使用 WooCommerce REST API："]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["WooCommerce 提供完善的 REST API，讓外部應用程式與您的商店資料互動。"," ","您可以在 WooCommerce > Settings > Advanced > REST API 中，建立具有特定權限（讀取、寫入，或讀寫）的 API 金鑰。"," ","這讓您可以透過建立自訂整合，或使用運用此 API 的第三方服務，自動化庫存同步、訂單處理、客戶資料同步等任務。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["使用外掛："]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["許多 WordPress 與 WooCommerce 外掛專為整合熱門第三方服務而設計，例如金流服務、貨運服務、CRM 系統與會計軟體。"," ","外掛通常提供現成的整合，簡化設定流程，減少自訂程式碼的需求。"," ","範例包括特定支付處理器的外掛（例如 Stripe、PayPal）、貨運解決方案（例如 FedEx、USPS），或如 WPGet API 等通用 API 整合工具。"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["自訂程式碼與 Webhooks："]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["對於獨特的整合需求，或沒有合適外掛可用時，您可以在 WordPress 佈景主題或自訂外掛中實作自訂程式碼。"," ","這涉及使用 WordPress/WooCommerce 的 hooks 與 filters，在特定事件觸發時呼叫 API（例如 woocommerce_payment_complete 用於購買後的動作）。"," ","也可以使用 Webhooks，在特定事件發生時（例如新訂單、產品更新），將即時資料從 WooCommerce 送至第三方服務。"," ",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}]}]}]}]}]}]},"headings":[{"value":"FAQ","id":"faq","depth":1}],"frontmatter":{"seo":{"title":"FAQ"}},"lastModified":"2026-10-30T07:26:32.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/zh-tw/develop/faq","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}