# Connect Cloud: Configuring the API Connector

**URL:** <https://community.cdata.com/t/connect-cloud-configuring-the-api-connector/425>\
**Category:** Getting started\
**Tags:** article, connect-cloud, api\
**Created:** [September 29, 2023, 2:21pm UTC](https://community.cdata.com/t/connect-cloud-configuring-the-api-connector/425 "2023-09-29T14:21:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jerodj-cdata](https://sea3.discourse-cdn.com/cdata/user_avatar/community.cdata.com/jerodj-cdata/32/7_2.png) [@jerodj-cdata](https://community.cdata.com/u/jerodj-cdata)\
**Post date:** [September 29, 2023, 2:21pm UTC](https://community.cdata.com/t/connect-cloud-configuring-the-api-connector/425/1 "2023-09-29T14:21:23Z")

</div>

The API Connector in CData Connect Cloud lets you connect to any cloud-based API that produces XML or JSON data. This means that you can work with data from custom or proprietary APIs from your preferred tools and applications, just like you can with data from any of the 250+ natively supported sources.

This article guides you through the process of creating a connection to an API and creating tables for various API endpoints. In this article, we will use the Trip Pin RW [OData v4 reference services](https://www.odata.org/getting-started/understand-odata-in-6-steps/), but the principles apply to any API.

## Create the connection and configure global settings&nbsp;

1. Navigate to the **Connections** page of Connect Cloud and click “+ Add Connection.” Search for “API” and choose the API connector.

2. Next name the connection and configure the Global Settings.

### Authentication&nbsp;

By default, an API connector is set to No Auth for its Authentication Type. The sample OData API doesn’t require authentication, so we will leave the **Type** as “No Auth.”

For more information on the different authentication types available, refer to our [documentation](https://cloud.cdata.com/docs/APIConnector.html%22%20/l%20%22authentication).

### **Headers** &nbsp;

To add HTTP headers that are sent with all API calls, do the following:

1. Enter the header name in the **Name** field.
2. Specify the value of the header in the **Value** field.

To add additional headers, click **Add Header** and repeat the above steps as required.

While the sample OData API doesn’t require any headers, we can add an “Accept” header with the value “application/json” to tell the server that CData Connect Cloud can understand and process JSON responses.

 ![7d5967a5-559f-4e90-97c4-cc51d9a2193a.png](https://us1.discourse-cdn.com/cdata/original/2X/8/82ece99e5d431877367df4b2de39d339ebab3cbb.png)

### Pagination&nbsp;

You can specify the pagination **Type** to use with API Connector to manage paged responses (when a service only returns a subset of the collection with each request).

The OData V4 API response for the People entity set ([https://services.odata.org/v4/TripPinServiceRW/People](https://services.odata.org/v4/TripPinServiceRW/People)) looks like the following:

```json
{ "@odata.context": "http://.../TripPinServiceRW/$metadata#People", "@odata.nextLink": "https://.../TripPinServiceRW/People?%24skiptoken=8", "value": [ { "@odata.id": "http://.../TripPinServiceRW/People('russellwhyte')", "@odata.etag": "W/\"08DBBDFC84D9BE44\"", "@odata.editLink": "http://.../TripPinServiceRW/People('russellwhyte')", ..., }, ... } 

```

The **@odata.nextLink** field represents the URL of the next “page” of data for the API. Set the Pagination **Type** to “URL,” select “Response Body” for **Response Type** and set **Response Body** to “/@odata.nextLink” (the “/” indicates the top of the response body) to configure pagination for our example API.

 ![999cb223-7547-4dba-92ff-03f10fce6e99.png](https://us1.discourse-cdn.com/cdata/original/2X/8/83f0769f7c276085cd071e42ddea99013d56359a.png)

### &nbsp;Advanced&nbsp;

The **Verbosity** field should be left at 1 unless required for troubleshooting purposes.

After creating an API connection, proceed to Creating Tables.

## Creating tables&nbsp;

When creating tables for API Connector, it is important to remember that each table must be created individually to be listed in the Connector’s catalog. To do so, follow the steps below.

1. Click **Add** to begin creating a new table.
2. Enter a **Name** for the table (e.g. “people”).
3. In **Request URL** , choose either Get or Post. If you select Post, supply the **Body** to include in the API request. Then enter the URL of your API endpoint (e.g. “[https://services.odata.org/v4/TripPinServiceRW/People](https://services.odata.org/v4/TripPinServiceRW/People)”).
4. Select JSON as the **Response Type**.

 ![b635e054-58fa-4276-81d8-857c5b169497.png](https://us1.discourse-cdn.com/cdata/original/1X/ad607832b06c0e6d50114cd8b4f9d3b7ad65f377.png)

### Parameters&nbsp;

You can add URL parameters to be sent with all API requests for this table. To create a parameter:

1. Enter the parameter **Name**.
2. Specify the parameter **Value**.

To add additional parameters, click **Add Param** and repeat the steps above.

### Headers&nbsp;

You can add HTTP headers that are sent with all API requests for this table. These headers are in addition to the headers configured when configuring the API connector itself. To add a new header:

1. Enter the header **Name**.
2. Specify the **Value** of the header.

To add additional headers, click **Add Header** and repeat the steps above.

### Table Data&nbsp;

Next you must tell the connector how to model the API’s response into a table. You can use the wizard to make this easier or directly edit the table data settings.

**Configure table data using the wizard**

1. Click **Configure** in the upper right of the Table Data section to open the configuration wizard.  

2. In the configuration wizard, verify the API response, and click **Next**.  

3. Use the checkboxes on the right to specify the **Root Path**. This is the path of the element in your API endpoint which contains the repeating items to be used as rows. You can select multiple root paths if there are repeated elements within multiple paths in the response.

4. Use the checkboxes on the left to select the columns to include in your table. Once you have selected your columns, click **Next**.  

5. Double check the preview of your table and click **Next**. The Configuration Wizard automatically imports all selected columns into the correct fields. You can also edit these fields as needed or add new ones manually outside the wizard.  

### **Filters** &nbsp;

After creating the table with columns, you can create filters to define the behavior of the API Connector when a WHERE clause is issued during a query. Filters can improve performance by delegating filtering to the API. If no filters are included, query options are processed by Connect Cloud instead. We won’t enable filters in this example, but to learn more, refer to our [documentation](https://cloud.cdata.com/docs/APICreateTable.html%22%20/l%20%22filters).

## Free trial & more information&nbsp;

To learn more about CData Connect Cloud and get live data access to your API data (and data from 100+ other SaaS, Big Data, and NoSQL sources) directly from your cloud applications, visit our [CData Connect Cloud](https://www.cdata.com/cloud) page or [sign up for a free trial](https://cloud.cdata.com/auth/sign-up-initial) today!
