# GetResponse

GetResponse is an email marketing and automation platform that provides tools for managing contact lists, sending newsletters, building landing pages, creating automation workflows, and running webinars. The Sling GetResponse connector extracts data from the GetResponse API v3, supporting contacts, campaigns, newsletters, tags, automation workflows, ecommerce data, and more.

{% hint style="success" %}
**CLI Pro Required**: APIs require a [CLI Pro token](https://docs.slingdata.io/sling-cli/cli-pro) or [Platform Plan](https://docs.slingdata.io/sling-platform/platform).
{% endhint %}

## Setup

The following credentials and inputs are accepted:

**Secrets:**

* `api_key` **(required)** -> Your GetResponse API key

**Inputs (optional):**

* `anchor_date` (optional) -> Starting date for first sync in `YYYY-MM-DD` format. Defaults to 1 year ago.

### Getting Your API Key

1. Log in to your [GetResponse account](https://app.getresponse.com/)
2. Navigate to **Integrations & API** from the top menu, or go directly to <https://app.getresponse.com/api>
3. Click the **API** tab
4. Click **Generate API key**
5. Give it a name (e.g., "Sling Integration")
6. Click **Generate** and copy the key

{% hint style="warning" %}
**Important:** API keys expire after 90 days of inactivity. If your key stops working, generate a new one from the API settings page.
{% endhint %}

### Using `sling conns`

{% code overflow="wrap" %}

```bash
sling conns set GETRESPONSE type=api spec=getresponse secrets='{ api_key: "your_api_key_here" }'
```

{% endcode %}

### Environment Variable

See [here](https://docs.slingdata.io/sling-cli/environment#dot-env-file-.env.sling) to learn more about the `.env.sling` file.

{% code overflow="wrap" %}

```bash
export GETRESPONSE='{ type: api, spec: getresponse, secrets: { api_key: "your_api_key_here" } }'
```

{% endcode %}

### Sling Env File YAML

See [here](https://docs.slingdata.io/sling-cli/environment#sling-env-file-env.yaml) to learn more about the sling `env.yaml` file.

```yaml
connections:
  GETRESPONSE:
    type: api
    spec: getresponse
    secrets:
      api_key: "your_api_key_here"
```

## Replication

Here's an example replication configuration to sync GetResponse data to a PostgreSQL database:

```yaml
source: GETRESPONSE
target: MY_POSTGRES

defaults:
  mode: full-refresh
  object: getresponse.{stream_name}

streams:
  # Core contact data (incremental)
  contacts:
    mode: incremental

  # Lists and segmentation
  campaigns:
  tags:
  custom_fields:

  # Email marketing
  newsletters:
    mode: incremental
  autoresponders:
  from_fields:

  # Automation
  workflows:

  # Ecommerce
  shops:
  orders:
  products:
```

**Incremental sync example:**

```yaml
source: GETRESPONSE
target: MY_POSTGRES

defaults:
  mode: incremental
  object: getresponse.{stream_name}

streams:
  contacts:
  newsletters:
```

## Endpoints

### Contacts & Lists

| Endpoint        | Description                                              | Incremental       |
| --------------- | -------------------------------------------------------- | ----------------- |
| `contacts`      | All contacts/subscribers with campaign and activity data | Yes (`changedOn`) |
| `campaigns`     | Contact lists (campaigns)                                | No                |
| `custom_fields` | Custom field definitions                                 | No                |
| `tags`          | Contact tags                                             | No                |
| `suppressions`  | Suppression lists                                        | No                |
| `imports`       | Contact import history                                   | No                |

### Email Marketing

| Endpoint                | Description                                      | Incremental       |
| ----------------------- | ------------------------------------------------ | ----------------- |
| `newsletters`           | Email broadcasts/newsletters                     | Yes (`createdOn`) |
| `newsletter_statistics` | Per-newsletter statistics (child of newsletters) | No                |
| `autoresponders`        | Autoresponder messages                           | No                |
| `rss_newsletters`       | RSS-based newsletters                            | No                |
| `from_fields`           | Sender email addresses                           | No                |

### Automation & Content

| Endpoint        | Description          | Incremental |
| --------------- | -------------------- | ----------- |
| `workflows`     | Automation workflows | No          |
| `landing_pages` | Landing pages        | No          |
| `webinars`      | Webinars             | No          |

### Ecommerce

| Endpoint   | Description                        | Incremental |
| ---------- | ---------------------------------- | ----------- |
| `shops`    | Ecommerce shops                    | No          |
| `orders`   | Orders per shop (child of shops)   | No          |
| `products` | Products per shop (child of shops) | No          |

### Account

| Endpoint   | Description         | Incremental |
| ---------- | ------------------- | ----------- |
| `accounts` | Account information | No          |

## Incremental Sync

The `contacts` endpoint supports true incremental sync using the `changedOn` field, which captures both new contacts and updates to existing ones. The `newsletters` endpoint supports append-only incremental sync using the `createdOn` field.

Use the `anchor_date` input to control how far back the initial sync reaches:

```yaml
connections:
  GETRESPONSE:
    type: api
    spec: getresponse
    secrets:
      api_key: "your_api_key_here"
    inputs:
      anchor_date: "2024-01-01"
```

If you are facing issues connecting, please reach out to us at <support@slingdata.io>, on [discord](https://discord.gg/q5xtaSNDvp) or open a Github Issue [here](https://github.com/slingdata-io/sling-cli/issues).
