Integrating Mailchimp Using API Call Notifications
Last edit: Nov 28, 2022
This guide will help you create a Mailchimp integration for platformOS using API Call Notifications.
Requirements
To follow this tutorial, you should be familiar with creating API Call Notifications. You also have to have access to the Partner Portal and know how to manage integrations, and have a Mailchimp account where you can find your API key.
- Creating an API Call Notification
- Register on the Partner Portal
- Mailchimp: Find or generate your API key
Steps
Integrating Mailchimp using API Call Notifications is a two-step process:
Step 1: Create API Call Notification
Create an API Call Notification:
- Replace
<<YOUR_API_KEY>>
with your Mailchimp API key - Replace
<<YOUR_DC_KEY>>
with the last part of your Mailchimp API key (the part after the-
, for examplexxxxxxxxxxxxxxxxxxxxxxxxxx-us3
whereus3
is the DC_KEY) - Replace
<<YOUR_AUDIENCE_ID>>
with your Mailchimp Audience ID. To find that follow these steps:- Navigate to the Audience tab.
- If you have more than one audience, click the Current audience drop-down and choose the one you want to work with.
- Click on View Contacts.
- Click on the Settings drop-down and choose Audience name and defaults.
- In the Audience ID section, you’ll find a string of letters and numbers. This is your audience ID.
- Add the payload based on the attributes in your form.
---
name: mailchimp_new_host
to: 'https://<<YOUR_DC_KEY>>.api.mailchimp.com/3.0/lists/<<YOUR_AUDIENCE_ID>>/members/'
format: http
request_type: POST
request_headers: >
{
"Content-Type": "application/json",
"Authorization": "apikey <<YOUR_API_KEY>>"
}
---
{
"email_address":"",
"status":"subscribed",
"merge_fields": {
"FNAME": "",
"LNAME": ""
}
}
Step 2: Add API Call Notification to forms
Add the following to the front matter on your form:
api_call_notifications:
- mailchimp_new_host