Use MailChimp as a data source

Resources

Data Source Type: REST/URL
Authentication:

Basic Authentication using your API Key, and your Data Center

Sample Query:

For a list of MailChimp campaigns:

https://your-data-center.api.mailchimp.com/3.0/campaigns/

 

API Documentation: MailChimp API documentation
Date Ranges: Use Klipfolio Date Ranges
Klipfolio Blog Use MailChimp as data source
Klip Gallery

Save time and add pre-built Klips with the Klip Gallery!

Klip Gallery: MailChimp

Step-by-Step

Creating a data source using MailChimp

To create a data source using MailChimp, you need to accomplish 4 tasks:

  • Start the data source creation process.
  • Find your MailChimp API Key and data center.
  • Use the MailChimp API documentation to write a query.
  • Complete the data source creation process.

If you need to change your MailChimp data sources from version 2.0 to version 3.0,  follow the steps below.

Step 1: Start the data source creation process

To create a data source using MailChimp, go to the Connector Gallery page in Klipfolio and select MailChimp.

Step 2: Find your MailChimp API Key and data center:

Location Action
  • Click the following link: Your MailChimp API Key.
  • Enter your Mailchimp login credentials.
  • You now have a MailChimp API Key. You will use this in Klipfolio.
  • Your data center is at the end of your API Key. For example, us12.

Step 3: Use the MailChimp API documentation to complete a query

MailChimp provides you with many query options - you will want to refer to the MailChimp API documentation to get you started.

Here are a few sample queries to get you started:

For a list of MailChimp campaigns:

https://your-data-center.api.mailchimp.com/3.0/campaigns/

For all your MailChimp lists:

https://your-data-center.api.mailchimp.com/3.0/lists/

Edit the query date ranges and save

Many Klips that use MailChimp data need a date range that is dynamic (for example, past 30 days). In this section we're going to change the query from a fixed range to a dynamic one.

  1. Enter &since_send_time={date.last30Days} at the end of your query URL.
  2. Enter &before_send_time={date.today} at the end of your query URL (after the since_send_time parameter). Your query should look like this:
    • https://your-data-center.api.mailchimp.com/3.0/campaigns/?since_send_time={date.last30Days}&before_send_time={date.today}
  3. And if you want to increase the number of records that the call returns (the default is 10), you can add the count parameter. For example:
    • https://your-data-center.api.mailchimp.com/3.0/campaigns/?since_send_time={date.last30Days}&before_send_time={date.today}&count=100

Common date range expressions:

Step 4: Complete the data source creation process

Now that you have entered your query into Klipfolio:

  1. At Data Format, select JSON from the drop-down menu.
  2. At Method select GET from the drop-down menu.
  3. Select Authentication (OAuth, 2-Step, X-WSSE, or Basic).
  4. At Type, select Basic HTTP Authentication from the list.
  5. At Username, enter the letter 'x'.
  6. At Password, enter your Mailchimp API Key.

 

Upgrade your data sources to the latest version of MailChimp by December 31st, 2016

The MailChimp API is moving to version 3 on December 31st, 2016. Follow the steps below to upgrade any current MailChimp data sources to the latest version.

To find all of your Mailchimp data sources,

  1. From your dashboard, select Library at the top right.
  2. In the Library section, select Data Sources.
  3. Within the Data Sources section, use the search bar at the top right of the page to find your MailChimp data sources.
  4. Click on one of your current MailChimp data sources.
  5. On the About this Data Source page, click the button Reconfigure data source.

On the Edit Data Source page...

  1. Check to see if your data source is using version 2.0 or earlier (such as https://api.mailchimp.com/2.0). If it is, continue with the steps below.
  2. Copy the API Key that is in the Body section of your query and save it on your notepad.
  3. At Query URL, change the version number from 2.0 to 3.0, and adjust your endpoints.
    For example, https://Your-Data-Center.api.mailchimp.com/2.0/campaigns/list.json would change to https://Your-Data-Center.api.mailchimp.com/3.0/reports
    See the list below for more endpoint changes from version 2.0 to version 3.0.
  4. Add the ?count=1000 parameter to the end of your query so you have enough data to work with.
    For example, https://Your-Data-Center.api.mailchimp.com/3.0/reports?count=1000
  5. Now that you've updated your query, at Method, change POST to GET.
  6. Click on Authentication (OAuth, 2 Step, X-WSSE, or Basic).
  7. At Type, select Basic HTTP Authentication.
  8. At Username, enter the letter x
  9. At Password, paste your Mailchimp API Key.
  10. Click Get Resource.


Some MailChimp Endpoint changes from version 2.0 to 3.0

Use this list to make changing your endpoints easier and faster, but refer to Mailchimp 3.0 API documentation for a complete list of endpoints:

Version 2.0 Version 3.0
/campaigns/list 3.0/reports
/lists/list 3.0/lists
lists/growth-history 3.0/lists/{listID}/growth-history
/lists/activity 3.0/lists/{listID}/activity
/lists/members 3.0/lists/{listID}/members
/list/locations 3.0/lists/{listID}/locations
/lists/segments 3.0/lists/{listID}/segments
/list/abuse-reports 3.0/lists/{listID}/abuse-reports
/automations/list 3.0/automations
/reports/opened 3.0/reports/{campaignID}/?fields=opens
/reports/clicks 3.0/reports/{campaignID}/?fields=clicks
/reports/unsubscribes 3.0/reports/{campaignID}/unsubscribed
/reports/click-detail 3.0/reports/{campaignID}/click-details
/ecomm/orders 3.0/ecommerce/stores/{store_id}/orders
/folders//list 3.0/file-manager/folders