# 擷取適用於 Azure API 管理的 API 定義

從 API 合約 匯出與 Azure API 管理相容的 API 定義 JSON 檔案。

* 您已安裝 cURL。如需更多資訊，請參閱 [cURL 文件](https://curl.haxx.se/docs/)。
* 您已在 API 合約 中建立 API。

1. 開啟命令列並輸入以下命令以匯出您的 API 定義：
   ```
   curl --header "Authorization:Bearer {userToken}" -X GET -o {outFile}.json https://apid.{region}.cloud.talend.com/api/v1/api-definitions/{api-id}?format=Swagger20Azure
   ```
2. 新增正確的參數：
   | 參數 | 描述 |
   | --- | --- |
   | {userToken} | 權杖產生自 Qlik Talend Cloud。 |
   | {outFile} | 您的 API 定義的路徑與檔案名稱。例如：contactsapi.json |
   | {region} | 您 Qlik Talend Cloud 帳戶的區域。值可以是：<br><br><ul><li><span>us-west</span></li><li><span>us</span></li><li><span>eu</span></li><li><span>ap</span></li><li><span>au</span></li></ul><br><br>如需詳細資訊，請參閱 [存取 Talend Cloud 應用程式](https://help.qlik.com/talend/en-US/installation-guide-windows/Cloud/talend-cloud-application-url)。 |
   | {api-id} | 要擷取的 API 版本的 ID。若要取得，請在API 合約中開啟您的 API，然後前往設定 &gt; 管理 API，或使用GET 方法在/api-definitions 端點上取得 API 定義及其 ID 的清單。 |
3. 執行命令。

您的 API 定義會匯出為與 Azure API 管理相容的 JSON 檔案，並儲存到選取的目錄中。