I have a few lists in mailchimp, some which have thousands of users and one of the representatives recommended I merge some of my lists and use 'groups' (A.K.A. Interests) to target certain audiences.
I have one 'interest-category' that contains over 40 separate interests, and I want to get their IDs along side the names so I can subscribe users through the API and add them to the right 'groups/interests'.
I am so close to getting the interests along with their names, but the documentation does not say anything about increasing the amount of entries or going to the next 10. http://kb.mailchimp.com/api/resources/lists/interest-categories/interests/lists-interests-collection
If this helps at all, this is the code I used to pull up the interests. (Written in Python and uses the 'requests' library)
import requests
print "Name\tID"
r = requests.auth.HTTPBasicAuth('x', '00000000000000000000000000000-us4')
interest_categories_raw = requests.get('http://us4.api.mailchimp.com/3.0/lists/0000000000/interest-categories/', auth=r)
interest_categories = json.loads(interest_categories_raw.content)
for category in interest_categories['categories']:
url = 'http://us4.api.mailchimp.com/3.0/lists/0000000000/interest-categories/{0}/interests'.format(str(category['id']))
interests = json.loads(requests.get(url, auth=r).content)
for interest in interests['interests']:
print "{0}\t{1}".format(interest['name'],interest['id'])
Is there any way I can get the rest of the 'interests/groups', both the Name and the ID so I can assign them correctly? (Any way other than uploading test users and patching their interest data and checking the website to see what groups they are added into)