How To

Please, before you get too deep into anything, make sure that you've read our Getting Started Guide. Thanks!

Write-ups on some standard use cases that our customers have employed. These range from very basic to kind of complicated solutions for a variety of things:

  1. The Basic Subscribe Form
  2. Sending Transactional Emails
  3. Syncing Database Changes from You to Mailchimp
  4. Syncing Database Changes from Mailchimp to You – includes parts on redirecting users to your site after Opt-in, Profile editing, etc.
  5. Reproducing our Forward-to-a-Friend Program Links

Think we missed something, or have an example you'd like us to cover? Let us know!

Serialized How-tos

Folks using the serialized version of the API often have problems with exactly how to build-up the URLs. These examples try to spell that out a bit more clearly.

  1. Using HTTP GET/POST
  2. Merge Var Arrays via HTTP GET/POST
  3. Merge Var Arrays with Groupings via HTTP GET/POST

Example 1: Using HTTP GET/POST. Here we'll just create a url that you can use in whatever method you wish to grab the data (curl, wget, raw sockets, etc).

#Return format is a php serialized array
              http://<dc>.api.mailchimp.com/1.3/?method=listMemberInfo
                &apikey=<apikey - captured from your API dashboard>
                &id=<list id - captured from lists()>
                &email_address=<email_address>
                &merge_vars=
                &output=php
              
              #Return format is a JSON objects
              http://<dc>.api.mailchimp.com/1.3/?method=listMemberInfo
                &apikey=<apikey - captured from your API dashboard>
                &id=<list id - captured from lists()>
                &email_address=<email_address>
                &merge_vars=
                &output=json

Example 2: Setting Merge Var arrays when using HTTP GET/POST URL strings. This is just a sample of what your URL string should look like if you wish to pass Merge Vars and/or Interest Groups into the listSubscribe() function. Other functions that accept arrays of parameters should look similar.

#Return format is a JSON object
              http://<dc>.api.mailchimp.com/1.3/?method=listSubscribe
                &apikey=<apikey - captured from your API dashboard>
                &id=<list id - captured from lists()>
                &email_address=<email_address>   
                &merge_vars[FNAME]=Firstname
                &merge_vars[LNAME]=Lastname
                &merge_vars[INTERESTS]=Dogs,Cats,Shoes
                &output=json

Example 3: Setting Merge Var arrays that include the GROUPINGS array when using HTTP GET/POST URL strings. Essentially this is an example to show you how nested/multi-dimensional arrays should be passed in. In this example, the list has two Groupings - "Pets" and "Food" - and we are selecting the "Cat" and "Dog" options for the Pets group and the "Meat" and "Kibble" option for the Food group. Note that the 0 and 1 keys are not used - they simply need to be included to identify they arrays of arrays which are being passed.

#Return format is a JSON object
              http://<dc>.api.mailchimp.com/1.3/?method=listSubscribe
                &apikey=<apikey - captured from your API dashboard>
                &id=<list id - captured from lists()>
                &email_address=<email_address>   
                &merge_vars[FNAME]=Firstname
                &merge_vars[LNAME]=Lastname
                &merge_vars[GROUPINGS][0][name]=Pets
                &merge_vars[GROUPINGS][0][groups]=Cat,Dog
                &merge_vars[GROUPINGS][1][name]=Food
                &merge_vars[GROUPINGS][1][groups]=Meat,Kibble
                &output=json

No idea what the <dc> is? Read about "Submit URLs" in the documentation

Still not clear? Get in touch with us!

Documentation

Export API

Simple Transactional Service (STS)

WebHooks