# Fetching an API definition for Azure API Management

Export an API definition as a JSON file compatible with Azure API Management from Talend Cloud API Designer.

## Before you begin

* You have installed cURL. For more information, see the [cURL documentation](https://curl.haxx.se/docs/).
* You have generated a Personal Access Token from Talend Cloud. For more information, see [Generating a Personal Access Token](https://help.qlik.com/talend/r/en-US/Cloud/management-console-user-guide/cloud-access-token).
* You have created an API in Talend Cloud API Designer.

## Procedure

1. Open a command line and enter the following command to export your API definition:
   ```
   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. Add the correct parameters:
   | Parameter | Description |
   | --- | --- |
   | {userToken} | Token generated from Talend Cloud. |
   | {outFile} | Path and filename of your API definition. For example: contactsapi.json |
   | {region} | Region for your Talend Cloud account. The value can be:<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>For more information, see [Accessing Talend Cloud applications](https://help.qlik.com/talend/en-US/installation-guide-windows/Cloud/talend-cloud-application-url). |
   | {api-id} | ID of<br>the API version to fetch. To get it, open your API in Talend Cloud API Designer and go to Settings &gt; MANAGEMENT API or use the GET method on the /api-definitions endpoint to get a list<br>of API definitions with their IDs. |
3. Execute the command.

## Results

Your API definition is exported as a JSON file compatible with Azure API Management and saved in the selected directory.

For more information about exporting an API definition with an API gateway compatibility mode, see the [Talend Cloud API Designer User Guide](https://help.qlik.com/talend/r/en-US/Cloud/api-designer-user-guide).