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

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.

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 (without the data center).