Q:
How do I add my own authentication key using MailChimp API v3?
I'm having trouble to add a key to my account. I got it to work by using the "authentication-key" field in the "list-creator" object, but I don't want to use the key I have, I want to use a new one. So, I tried to use the "authentication-key" field in the "list-member" object and it says it's not allowed and it should only be used by the list-creator.
If you are using a key other than your own and you wish to add it to your MailChimp account, you can do so here. To use this key, you can include it in the "authentication-key" field of the "list-member" object when creating a list.
So, I tried to insert it into the "list-member" object by means of this. (Note: I'm using the python api)
def add_to_lists(self, template_id, template_name):
"""Adds the member to MailChimp list
:param template_id: The id of the list you wish to add the member to
:param template_name: The list you wish to add the member to
"""
api = API(self.api_key, self.api_secret)
# Add the list members to the mail list
member_list = api.lists.members.list(template_id)
member_list.add_to_list(template_name)
# Verify if member was added to the list
resp = member_list.check_list(template_name)
# Make sure the member was added
self.api_log('membership added.')
return resp
But I get this:
Traceback (most recent call last):
File "add_to_lists.py
Related links:
Comentarios