> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloud.cdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Retool

> You can connect Retool to Connect AI via the OpenAPI specification or via the Virtual SQL Server API. Follow the prerequisites and steps for the method you want to use.

## Prerequisites for Connecting via OpenAPI

Before you connect via OpenAPI, you must first do the following:

* In Connect AI:
  * Connect a data source to your Connect AI account. See [Sources](https://docs.cloud.cdata.com/ja/Sources.md) for more information.
  * [Add a virtual schema](https://docs.cloud.cdata.com/ja/Virtual-Schemas.md#仮想スキーマを追加) to Virtual Schemas.
  * [Add assets](https://docs.cloud.cdata.com/ja/Virtual-Schemas.md#仮想スキーマのアセット) to your virtual schema.
  * Generate a Personal Access Token (PAT) on the [Settings](https://docs.cloud.cdata.com/ja/Settings/Personal-Access-Tokens.md) page. Copy this down, as it acts as your password during authentication.
* In Retool:
  * Go to **Settings** > **API** and click **Create new** to generate an access token. See the [Retool documentation](https://docs.retool.com/org-users/guides/retool-api/authentication) for more information.

## Connect to Connect AI via OpenAPI

To establish a connection from Retool to Connect AI via OpenAPI, follow these steps.

**Step 1**

In **Virtual Schemas** in Connect AI, select a virtual schema and copy the OpenAPI URL for the virtual schema. Keep the default options. See [OpenAPI](https://docs.cloud.cdata.com/ja/API/OpenAPI.md) for more information.

![](https://mintcdn.com/cdata/6pGFG61-t-b5cPZl/ja/images/retool_client_endpoints_URL.png?fit=max\&auto=format\&n=6pGFG61-t-b5cPZl\&q=85\&s=ae018a713a8d914351cee73d5447854b)

**Step 2**

Log in to Retool.

**Step 3**

In the **Resources** tab, click **Create new** > **Resource**.

![](https://mintcdn.com/cdata/6pGFG61-t-b5cPZl/ja/images/retool_client_create_new.png?fit=max\&auto=format\&n=6pGFG61-t-b5cPZl\&q=85\&s=15a518102d7f2c1978599421ddab1d1c)

**Step 4**

In the **Select a resource type** search bar, enter *OpenAPI*.

![](https://mintcdn.com/cdata/6pGFG61-t-b5cPZl/ja/images/retool_client_openapi.png?fit=max\&auto=format\&n=6pGFG61-t-b5cPZl\&q=85\&s=f35b95011accc83391c0519ac1463541)

**Step 5**

Click **OpenAPI**. The **Configure OpenAPI** screen appears.

**Step 6**

Enter the following information to configure the OpenAPI connector:

* **Name**—the name to use to identify the connector.
* **Specification URL**—the OpenAPI URL you copied in Connect AI. Paste the URL here.
* **Forward headers when fetching OpenAPI spec**—must be selected.
* **Headers**—Authorization is *Basic*. Then, Retool requires that you Base64 encode your Connect AI username and PAT using the input format *username:PAT*. The PAT is the token you created in the prerequisites. You can use a tool such as the one [here](https://www.base64encode.org/). Click **Encode** and copy the Base64 encoded result into this field. For example, for *`test@cdata.com:12345`*, the Base64 encoded value is *dGVzdEBjZGF0YS5jb206MTIzNDU=*.
* **Username**—Connect AI のユーザー名を入力します。ユーザー名は、Connect AI の画面の右上に表示されています。例：*`test@cdata.co.jp`*
* **Password**—[Settings](https://docs.cloud.cdata.com/ja/Settings/Personal-Access-Tokens.md) ページで生成したPAT を入力します。

![](https://mintcdn.com/cdata/6pGFG61-t-b5cPZl/ja/images/retool_client_openapi_config.png?fit=max\&auto=format\&n=6pGFG61-t-b5cPZl\&q=85\&s=355d4c4b1238ef11c24939524654db83)

**Step 7**

Click **Test connection** to test your connection configuration.

**Step 8**

Once you have a successful connection, click **Create resource**.

**Step 9**

Create the app in Retool in which to integrate your data.

**Step 10**

Click **Create resource query**.

![](https://mintcdn.com/cdata/6pGFG61-t-b5cPZl/ja/images/retool_client_create_resource.png?fit=max\&auto=format\&n=6pGFG61-t-b5cPZl\&q=85\&s=c941ee62ed867ee395c19c941669efe9)

**Step 11**

Select the new resource you created, and view the endpoints that are available.

![](https://mintcdn.com/cdata/6pGFG61-t-b5cPZl/ja/images/retool_client_endpoints.png?fit=max\&auto=format\&n=6pGFG61-t-b5cPZl\&q=85\&s=51b21eee950370569597a0a56707262c)

**Step 12**

You can now build your app with the data.

![](https://mintcdn.com/cdata/6pGFG61-t-b5cPZl/ja/images/retool_client_create_app.png?fit=max\&auto=format\&n=6pGFG61-t-b5cPZl\&q=85\&s=230d82f768b356cecb1ec372a81a232c)

## Prerequisites for Connecting via Virtual SQL Server API

Before you connect, you must first do the following:

* Connect a data source to your Connect AI account. See [Sources](https://docs.cloud.cdata.com/ja/Sources.md) for more information.
* Generate a Personal Access Token (PAT) on the [Settings](https://docs.cloud.cdata.com/ja/Settings/Personal-Access-Tokens.md) page. Copy this down, as it acts as your password during authentication.

## Connect to Connect AI via Virtual SQL Server API

To establish a connection from Retool to the Connect AI Virtual SQL Server API, follow these steps.

**Step 1**

Log in to Retool.

**Step 2**

Under **Resources**, click **Connect a resource**.

![](https://mintcdn.com/cdata/6pGFG61-t-b5cPZl/ja/images/retool_client_01.png?fit=max\&auto=format\&n=6pGFG61-t-b5cPZl\&q=85\&s=04ac44525f238b3a9ffa73648783828d)

**Step 3**

Enter "Microsoft SQL" in the search bar and click the resulting option.

![](https://mintcdn.com/cdata/6pGFG61-t-b5cPZl/ja/images/retool_client_02.png?fit=max\&auto=format\&n=6pGFG61-t-b5cPZl\&q=85\&s=32b4651eae34fcc6896ddaaacfc26aec)

**Step 4**

Enter the connection settings.

* **Name**—a name for the connection to Connect AI
* **Host**—*tds.cdata.com*
* **Port**—*14333*
* **Database name**—接続したいConnect AI データソースのConnection Name を入力します。例：*Salesforce1*
* **Database username**—Connect AI のユーザー名を入力します。ユーザー名は、Connect AI の画面の右上に表示されています。例：*`test@cdata.co.jp`*
* **Database password**—[Settings](https://docs.cloud.cdata.com/ja/Settings/Personal-Access-Tokens.md) ページで生成したPAT を入力します。

![](https://mintcdn.com/cdata/6pGFG61-t-b5cPZl/ja/images/retool_client_03.png?fit=max\&auto=format\&n=6pGFG61-t-b5cPZl\&q=85\&s=03acaa7ef4582393fb63296321e454cb)

**Step 5**

Click **Test connection**. If it succeeds, you can click **Create resource**. Your connection to Connect AI is ready to use.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.