# Importing API Definition

This article explains how API definitions can be imported from local files or URLs into the Element Repository to automatically create Webservice elements and streamline API configuration.&#x20;

You can import API Definition into the Element Repository using following options:&#x20;

* [**Create Folder** **(+) icon** ](#importing-api-definition-using-create-folder--icon)
* [**Ellipsis (...) icon**](#importing-api-definition-using-ellipsis-...-icon)

## Importing API Definition using Create Folder (+) Icon

To Import API Definition in Element Repository using **Create Folder (+)** icon, perform the following actions:&#x20;

1. On the **Home** page, under **Projects**, select the required **Project**.&#x20;
2. Select **Design Studio**. In the **Element Repository** page, locate the **Create Folder (+)** icon. &#x20;
3. Select **Create Folder (+)** icon and select **Create new folder** to create a new folder for element repository. A new folder is created. &#x20;
4. In the **New Folder** text box, enter the element repository folder name. &#x20;

<figure><img src="/files/GFgW2OehWIrnYbpgaQYX" alt=""><figcaption></figcaption></figure>

5. Select the newly created element repository folder and select **Create Folder (+)** icon.&#x20;
6. From the menu options, select **Import API Definition**. The **Import API Definition** dialog box appears.&#x20;

<figure><img src="/files/vg4ZOs6ebXca91HZl7us" alt=""><figcaption></figcaption></figure>

7. You can import API definition using the following options:&#x20;
   * **File**&#x20;
   * **URL**&#x20;

<details>

<summary><strong>File</strong></summary>

To import an API definition using **File** option, perform the following actions:  &#x20;

1. In the **Import API Definition** dialog box, select the **Upload JSON File** button.&#x20;
2. Select the appropriate **JSON File** from your local system.&#x20;
3. Select the **Import API** to import the selected JSON File.&#x20;

<figure><img src="/files/OleBcXJrGJtdJDGnBMQQ" alt=""><figcaption></figcaption></figure>

4. After the API definition is imported, it appears in the **Element Repository** page.

<figure><img src="/files/v7hm9FMRvWTgHhg9qlDr" alt=""><figcaption></figcaption></figure>

</details>

<details>

<summary><strong>URL</strong></summary>

To import an API definition using **URL** option, perform the following actions:  &#x20;

1. In the **Source label** text box, enter the API endpoint URL.&#x20;
2. From the **Protocol** dropdown, select the required protocol.

{% hint style="info" %}
**Note**: &#x20;

* When using SOAP service, make sure to enter **?WSDL** at the end of URL entered in **Source label** text box which automatically selects prototype as WSDL. \
  For example:  <https://ecs.syr.edu/faculty/fawcett/code/calcWebService/Calc.asmx?WSDL>
* When using Rest service, **Swagger** protocol must be selected.&#x20;
  {% endhint %}

3. Select **Import API** button to import API Definition.&#x20;

<figure><img src="/files/aO4ySb4d84bgSEOcSe2c" alt=""><figcaption></figcaption></figure>

4. After the API definition is imported, it appears in the **Element Repository** page.

<figure><img src="/files/E9fNdV9Bb6nWmWRxPsvN" alt=""><figcaption></figcaption></figure>

</details>

8. Select the **send** button to execute the imported API definition.

{% hint style="info" %}
After executing the API request, you can go to **Response** tab to view the result. To learn more, [click here](broken://pages/OUQaviYR1pvloKnCAsoJ).&#x20;
{% endhint %}

9. Select the **save** button to store the configuration as a Webservice element.&#x20;

<figure><img src="/files/zHoL402Q6IniU7ZzGOPj" alt=""><figcaption></figcaption></figure>

## Importing API Definition using Ellipsis (...) Icon

To Import API Definition in Element Repository by selecting **ellipsis (...)** icon, perform the following actions:&#x20;

1. In **Element Repository** page, select the parent folder in which you want to import the API definition.&#x20;
2. Select the **ellipsis (...)** icon corresponding to that folder.&#x20;
3. From the menu options, select **Import Definition**. The **Import API Definition** dialog box appears.&#x20;

<figure><img src="/files/YAreZtrJPZvWFa2o43uR" alt=""><figcaption></figcaption></figure>

4. You can import API definition using the following options:&#x20;
   * **File**&#x20;
   * **URL** &#x20;

<details>

<summary><strong>File</strong></summary>

To import an API definition using **File** option, perform the following actions:  &#x20;

1. In the **Import API Definition** dialog box, select the **Upload JSON File** button.&#x20;
2. Select the appropriate **JSON File** from your local system.&#x20;
3. Select the **Import API** to import the selected JSON File.&#x20;

<figure><img src="/files/OleBcXJrGJtdJDGnBMQQ" alt=""><figcaption></figcaption></figure>

4. After the API definition is imported, it appears in the **Element Repository** page.

<figure><img src="/files/v7hm9FMRvWTgHhg9qlDr" alt=""><figcaption></figcaption></figure>

</details>

<details>

<summary><strong>URL</strong></summary>

To import an API definition using **URL** option, perform the following actions:  &#x20;

1. In the **Source label** text box, enter the API endpoint URL.&#x20;
2. From the **Protocol** dropdown, select the required protocol.
3. Select **Import API** button to import API Definition.&#x20;

{% hint style="info" %}
**Note**: &#x20;

* When using SOAP service, make sure to enter **?WSDL** at the end of URL entered in **Source label** text box which automatically selects prototype as WSDL. \
  For example:  <https://ecs.syr.edu/faculty/fawcett/code/calcWebService/Calc.asmx?WSDL>
* When using Rest service, **Swagger** protocol must be selected.&#x20;
  {% endhint %}

<figure><img src="/files/aO4ySb4d84bgSEOcSe2c" alt=""><figcaption></figcaption></figure>

4. After the API definition is imported, it appears in the **Element Repository** page.

<figure><img src="/files/E9fNdV9Bb6nWmWRxPsvN" alt=""><figcaption></figcaption></figure>

</details>

5. Select the **send** button to execute the imported API definition.

{% hint style="info" %}
After executing the API request, you can go to **Response** tab to view the result. To learn more, [click here](broken://pages/OUQaviYR1pvloKnCAsoJ).&#x20;
{% endhint %}

6. Select the **save** button to store the configuration as a Webservice element.&#x20;

<figure><img src="/files/zHoL402Q6IniU7ZzGOPj" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.avoautomation.com/avo-assure/avo-assure-supported-technologies-for-automation/webservice-automation/creating-webservice-element/importing-api-definition.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
