# Integrating with Mailchimp

Let’s say you’d like to have a capture form and them add them to a Mailchimp (or other email subscriber) list… it’s easy:

1\) Create your form in your Buzzy microapp

<div align="left"><img src="/files/K0ZyaHoOsq6sYpWpYeIS" alt=""></div>

Resulting in

<div align="left"><img src="/files/82nvGWt9VlZOZA4PUW9D" alt=""></div>

2\) You’ll need the details to make a REST API call to your list sever. For example, with Mailchimp, you’ll first need to [get an API key](https://mailchimp.com/help/about-api-keys/?utm_source=mc-api\&utm_medium=docs\&utm_campaign=apidocs&_ga=2.173762212.600914683.1551221719-1533229241.1551221719&_gac=1.229237032.1551257382.EAIaIQobChMIjbnfhsTb4AIVwxx9Ch0G2QAUEAAYASAAEgLjWfD_BwE)

Next we need to know what the API url will look like `https://<dc>.api.mailchimp.com/3.0/lists/<list_id>/members/`

You’ll need to know what the `<dc>` bit is, with are the last few characters of your API key you generated above after the minus `-` sign. For example

For example if your API key is something like `<somlongstring>-us20` the `dc` but is the `us20`. So your API url should be `https://us20.api.mailchimp.com/3.0/lists/<list_id>/members/`

No you just need the `<list_id>` which you can get by going to the `List name and campaign defaults` and you should be able to see your list id

<figure><img src="/files/0Sn1dZ5HVeYZpy8pEGMj" alt=""><figcaption></figcaption></figure>

Let’s pretend it’s `12345`

So now you should be able to generate a api call to add a member to a list with `https://us20.api.mailchimp.com/3.0/lists/12345/members/`

3\) Create a rule when a new row is submitted with a `Send to JSON` `POST` request, like so

<figure><img src="/files/7cMtyqxS73NkJmNlqejh" alt=""><figcaption></figcaption></figure>

For the `username` you can user anything. For the password use your API key you generated in Mailchimp in step 2 above

for the `JSON` bit use this as the minimum, passing any additional fields to Mailchimp for display

```
{
    "email_address": "{{{email}}}",
    "status": "subscribed",
    "merge_fields": {
        "FNAME": "{{{First Name}}}",
        "LNAME": "{{{Last Name}}}"
    }
}
```

Note the fields `email`, `First Name` and `Last Name` match to the labels in your Buzzy form fields. Use trile curly braces `{{{<field name>}}}` when you want to pass the exact value, use double braces `{{<field name>}}` for fields that may contain special characters (eg multi line text fields)

4\) Test the Form by submitting a new item, you should see a new subscriber be added to the list in Mailchimp

***


---

# 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.buzzy.buzz/rest-api/buzzy-rest-api/integrating-with-mailchimp.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.
