Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing 1 required positional argument #234

Open
Ryanauger95 opened this issue Jan 18, 2021 · 2 comments
Open

Missing 1 required positional argument #234

Ryanauger95 opened this issue Jan 18, 2021 · 2 comments

Comments

@Ryanauger95
Copy link

def addToAudience(email, fName, lName):
    try:
        response = mailchimp.lists.members.update('XXXXX', {
            'email_address': email,
            'status': 'subscribed',
            'data' : {},
            'merge_fields': {
                'FNAME': fName,
                'LNAME': lName,
                'data': {},
            }
        })
    except Exception as e:
        print("Exception:", e)

Exception: update() missing 1 required positional argument: 'data'

Is this an error from the mailchimp3 product or the Mailchimp API? Any idea how I could fix this?

@dfduarte
Copy link

dfduarte commented May 1, 2023

Hello, any updates on this?

I just stumbled upon in the same error

@andylolz
Copy link

andylolz commented Jun 7, 2023

Your function is called addToAudience, so I think you’re trying to create a new list member. So instead of mailchimp.lists.members.update, you should be using mailchimp.lists.members.create.

If you instead want to update, you need to provide a subscriber hash as the second positional argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants