> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://help.sigmacomputing.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://help.sigmacomputing.com/_mcp/server.

# Tutorial: Configure API credentials, connectors, and actions for the NYC Open Data API

> Tutorial: configure Sigma API credentials, connectors, and workbook actions for the NYC Open Data API.

You can create API credentials and connectors for third-party APIs in Sigma, allowing users to create actions that call those APIs in workbooks. For instructions on how to configure API credentials and connectors, see [Configure API credentials and connectors in Sigma](/docs/configure-api-credentials-and-connectors-in-sigma).

By following this tutorial, you can configure a credential and connector that allow you to call an endpoint from [NYC Open Data](https://opendata.cityofnewyork.us/), an NYC program that provides open access to data created by city agencies. This example uses a credential with basic authentication, as well as a dynamic query parameter that can be used to [Get JSON data from the NYC Open Data API in a workbook](#get-json-data-from-the-nyc-open-data-api-in-a-workbook).

## User requirements

* You must be assigned an account type with the **Manage API connectors** and **Create, edit, and publish workbooks** permissions enabled.

## Configure a credential and connector for an NYC Open Data API endpoint

To start, you must:

* Create an API credential to store your authentication credentials for the NYC Open Data platform.
* Create an API connector to use in a workbook.

### Setup and background

To follow along with this example step-by-step, you first need to create a free account with [NYC Open Data](https://data.cityofnewyork.us/signup), and create a new API key in the [developer settings](https://data.cityofnewyork.us/profile/edit/developer_settings) for your profile. The secret key can only be copied from the screen at the time of creation, so be sure to store it somewhere secure and accessible once created.

This example uses the [311 Service Requests from 2010 to Present dataset](https://data.cityofnewyork.us/Social-Services/311-Service-Requests-from-2010-to-Present/erm2-nwe9/about_data). Each record in this dataset is a service request made to [311](https://portal.311.nyc.gov/), a city agency that fields requests for information and complaints to city agencies.

### Create a credential

Create a credential to store your authentication credentials for the NYC Open Data platform.

1. Go to **Administration** > **API connectors**.
   1. From the Sigma header, click your user avatar to open the user menu.
   2. Select **Administration** to open the **Administration** portal.
   3. From the side panel, select **API connectors**.
2. Select the **Credentials** tab.
3. Click **Create credential**.

![The Create credential button in the Credentials tab of the API connectors page.](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/sigma.docs.buildwithfern.com/75bbfd3664499031d140feeae93e3b6275a4cd560206b1508b421685a5067b08/assets/docs-images/21997de22d76ffdfb41783ee8987d8e9042b3892e17abd8369b24599bbbe19fc-Example_create_credentia.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20261007%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20261007T121952Z&X-Amz-Expires=604800&X-Amz-Signature=9c761f028dc7382b3e62f12cd1667517a1d5230a7506dd736fc3aa930f44b900&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)

4. On the **New credential** screen, configure the following fields to define the credential:

   | Field                     | Value                                                                                                                                    |
   | :------------------------ | :--------------------------------------------------------------------------------------------------------------------------------------- |
   | **Name**                  | NYC Open Data Developer Credentials                                                                                                      |
   | **Description**           | For use with NYC Open Data API endpoints.                                                                                                |
   | **Authorized domains**    | Enter `*`                                                                                                                                |
   | **Authentication method** | Select **Basic auth**. For **Username**, enter your NYC Open Data API Key ID. For **Password**, enter your NYC Open Data API Key Secret. |

   > **Info**
   >
   > Though the NYC Open Data platform uses the term API key for the credential they provide, you can [read in their documentation](https://dev.socrata.com/docs/other/api-keys#?route=overview) that the API expects a basic authorization header in the request. For more information on correctly formatting the authorization header in cases like this, see [How Sigma handles authentication types in the request header](/docs/configure-api-credentials-and-connectors-in-sigma#how-sigma-handles-authentication-types-in-the-request-header).

5. Click **Save**.

### Create a connector

Using the credential from the previous section, create a connector to use in a **Call API** action.

1. Go to **Administration** > **API connectors**.
   1. From the Sigma header, click your user avatar to open the user menu.
   2. Select **Administration** to open the **Administration** portal.
   3. From the side panel, select **API connectors**.
2. Click **Create connector**.

![The Create connector button in the Connectors tab of the API connectors page.](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/sigma.docs.buildwithfern.com/98b2c728a0647ccba876144eb619cabc12d7c82ccc9d3814ade0e77b0c918cf0/assets/docs-images/ef7d06cf7f677642134c6d4713e9174785a3ac1b90c10b61319a270bca7fc777-Create_API_connector_example.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20261007%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20261007T121952Z&X-Amz-Expires=604800&X-Amz-Signature=be900a78851394684d922159b882c985d6410283ea13423731f3082a58494e2c&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)

3. On the **New API connector** screen, configure the following fields to define the connector:

   | Field                | Value                                                                                                                                                                             |
   | :------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   | **Name**             | NYC Open Data 311 with dynamic incident\_address                                                                                                                                  |
   | **Description**      | Basic auth connector for the 311 endpoint. GET request with dynamic parameter for incident\_address.                                                                              |
   | **Credentials**      | Select **NYC Open Data Developer Credentials**.                                                                                                                                   |
   | **Certificate**      | Select **No client certificate**.                                                                                                                                                 |
   | **Base URL**         | Select **GET** and enter the base URL `https://data.cityofnewyork.us/resource/erm2-nwe9.json`.                                                                                    |
   | **Query parameters** | Select ![](https://sigma-docs-screenshots.s3.us-west-2.amazonaws.com/Icons/add.svg) **Add parameter**. Enter `incident_address` as the key and select **Dynamic** for the values. |

   > **Tip**
   >
   > To create a dynamic connector that could be used for several NYC Open Data endpoints, you can use a path parameter in the **Base URL**, like the following: `https://data.cityofnewyork.us/resource/:resource`
   >
   > Under **Path parameters**, you can then set the mode to **Dynamic** to populate the `/:resource` parameter, allowing you to change the endpoint when using the connector in a workbook.

## Get JSON data from the NYC Open Data API in a workbook

You can create actions that call third-party APIs and make the response body available in your workbook for further manipulation or data enrichment.

By following this example, you can configure actions in a workbook that call the NYC Open Data API for data on 311 Service Requests. Users can provide an address to a dynamic parameter to see the service requests made at a specific address.

### Setup

To follow along with this example step-by-step, you first need to configure an API credential and connector as described in [Configure a credential and connector for an NYC Open Data API endpoint](#configure-a-credential-and-connector-for-an-nyc-open-data-api-endpoint).

### Configure workbook elements

In a new workbook page, add and configure the following elements:

1. From the **Add element** bar, select **UI**, and then **Button**.

2. From the **Add element** bar, select **Controls**, and then **Text Input**.

3. From the **Add element** bar, select **Controls**, and then **Text Area**.

4. Select the text area element. In the editor panel, configure it with the following settings:
   1. Rename the control **Response body**
   2. Set the **Control ID** to **response-body**

5. Select the text input element. In the editor panel, configure it with the following settings:
   1. Rename the control **Enter incident address**
   2. Set the **Control ID** to **enter-incident-address**

6. Select the button element. In the editor panel, configure it with the following settings:
   1. Under **Properties**, set **Text** to **Call 311 API**
   2. Under **Actions**, click ![](https://sigma-docs-screenshots.s3.us-west-2.amazonaws.com/Icons/add.svg)**Add action** to add two new actions to the **Action sequence** triggered **On click**

7. Configure the first action in the action sequence to call the API connector:

   |                       |                                                                                                    |
   | :-------------------- | :------------------------------------------------------------------------------------------------- |
   | **Action**            | Select **Call API**                                                                                |
   | **API**               | Select **NYC Open Data 311 with dynamic incident\_address**                                        |
   | **incident\_address** | Set the dynamic parameter based on a **Control** and select the **Enter incident address** control |

8. Configure the second action in the action sequence to update the text area control with the response body:

   |                    |                                                                                |
   | :----------------- | :----------------------------------------------------------------------------- |
   | **Action**         | Select **Set control value**                                                   |
   | **Update control** | Select **Response body**                                                       |
   | **Set value as**   | Select **Action variable** and then select the response data from **Call API** |

9. To test the **Call API** action, connector, and credentials, enter an NYC address into the **Enter incident address** control, and click the button to trigger the action sequence. If you want a sample address, try `124 EAST 14 STREET`.

When configured correctly, the text area control populates with the response body from the NYC Open Data API.

### Break the response body into tabular data

You can use a [custom action variable](/docs/configure-api-credentials-and-connectors-in-sigma#create-custom-action-variables-for-an-api-connector) and an **Insert row(s)** action to break the API response body into several rows and columns in an input table.

First, edit the API connector from the [Create a connector](#create-a-connector) section to add a custom action variable:

1. Go to **Administration** > **API connectors**.

2. Select the **NYC Open Data 311 with dynamic incident\_address** connector.

3. Select **Edit**.

4. In the **Response output** section, select **+ Add**.

5. Configure an action variable with the following settings:

   | Field             | Description                           |
   | :---------------- | :------------------------------------ |
   | **Variable name** | Enter **Incidents**.                  |
   | **Accessor**      | Enter `[response]`.                   |
   | **Shape**         | Select **Array** and then **Object**. |

6. Select **+ Add key** to add and configure the following four properties to parse from each object in the array:

   | Property                    | Type       |
   | :-------------------------- | :--------- |
   | **unique\_key**             | **Number** |
   | **agency\_name**            | **Text**   |
   | **created\_date**           | **Text**   |
   | **resolution\_description** | **Text**   |

![The configuration of a custom action variable shows the response treated as an array of objects, with four properties parsed from the object](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/sigma.docs.buildwithfern.com/a68582ac459a64259d7b1847c9f949ef94283660314f00dd6a56dd2c6dc387a9/assets/docs-images/1c6cf070d03bdbd416e14f71bdb100bcffa67335c253d1cd1739535f654457d4-parse_properties.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20261007%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20261007T121952Z&X-Amz-Expires=604800&X-Amz-Signature=19d97017b06411acc294d92b216c383228eff3f34cac14b730e9ea2e0ba60510&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)

7. Select **Save**.

After adding the action variable to the API connector, return to the workbook you configured in the [Configure workbook elements](#configure-workbook-elements) section and add an input table and an action to insert data from the response body as rows in the input table:

1. In the **Add element** bar, select **Input** > **Empty**.

2. Select a connection, and then select **Create**.

3. Name the input table **311 Incidents**.

4. Configure the input table with the following columns:

   | Column name                 | Data type  |
   | :-------------------------- | :--------- |
   | **unique\_key**             | **Number** |
   | **agency\_name**            | **Text**   |
   | **created\_date**           | **Text**   |
   | **resolution\_description** | **Text**   |

5. Select the **Call 311 API** button element.

6. In the editor panel, select **Actions**.

7. In the same action sequence with the **Call API** action you configured in the [Configure workbook elements](#configure-workbook-elements) section, select ![](https://sigma-docs-screenshots.s3.us-west-2.amazonaws.com/Icons/add.svg) **Add action**.

8. Configure the action with the following settings:

   | Field                 | Setting                                                                                                                          |
   | :-------------------- | :------------------------------------------------------------------------------------------------------------------------------- |
   | **Action**            | Select **Insert row(s)**.                                                                                                        |
   | **Insert type**       | Select **Source data**.                                                                                                          |
   | **Into**              | Select the **311 Incidents** input table.                                                                                        |
   | **From**              | Select **Action variable** and then select the **NYC Open Data 311 with dynamic incident\_address - Incidents** action variable. |
   | **Set column values** | For each column in the input table, select **Action variable** and then select the property of the same name as the column.      |

![The action sequence configuration for an insert rows action shows the incidents action variable parsed into columns in an input table](https://fdr-prod-docs-files-public.s3.us-east-1.amazonaws.com/sigma.docs.buildwithfern.com/d77b58848c7148c75c5826335f1dc6c86f022b65340703ac9677481b3a16b3ff/assets/docs-images/38d2d1525c8b259ae200d4bdca8aa3d8ca78b2f88c8228ca70fa976551fcaef1-action_config.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIA6KXJSKKNFOCF7G4B%2F20261007%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20261007T121952Z&X-Amz-Expires=604800&X-Amz-Signature=ded4296f5fbc919a5be98b3fd70ee4873f6fdbc98b72c2a34d44e34d462241ba&X-Amz-SignedHeaders=host&x-amz-checksum-mode=ENABLED&x-id=GetObject)

When the action sequence triggers, each object in the response array is inserted into its own row, with each configured property parsed into the selected column.

## Related resources

* [Configure API credentials and connectors in Sigma](/docs/configure-api-credentials-and-connectors-in-sigma)
* [Create actions that call API endpoints](/docs/create-actions-that-call-api-endpoints)