4

I am working on the MailChimp API, primarily on the list api (http://developer.mailchimp.com/documentation/mailchimp/reference/lists/)

Problem is

In MailChimp API 2.0, the grouping could be easily added to as suggested in their sample code

enter image description here

However, in MailChimp API 3.0 (which is REST based), I can't pass GROUPINGS to merge_vars as I get error that merge_vars.GROUPINGS are not defined in the schema and the request json is of the form

{
    ....,
    "merge_fields": {
        "FNAME": "Hello",
        "LNAME": "World"
     },
     "interests": {
        "{ids of the interest group}": true,
        .... : false
      } 
}

So, the new form requires me to pass the Id's of the interest. Now this is of course possible if I make separate call to other endpoint interest-categories, to get all the interests and then put true for whichever one interests the user and false otherwise. Also, the id is not for the interest category but for the interest itself, so I will have to make calls for each category...

However, that seems very clumsy and I am sure there would be an easier way to do this.

Will be thankful if someone could please point me in the right direction.

ekad
  • 14,436
  • 26
  • 44
  • 46
Prabhjot
  • 4,496
  • 2
  • 18
  • 22
  • I just talked to the representative of MailChimp and they suggested there isn't any easier way of doing this in API 3.0 as of now. So, the solution I am going to implement at the moment is (this might help someone) 1. Get all interest categories - 1 call 2. Get all interests of each category - Number of categories 3. Subscribe user Of course, I am going to store the id's in the properties file. However, in case if someone later come to know an easier way to solve this, then please add the link here. – Prabhjot Jul 18 '16 at 03:14

0 Answers0