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

Add query params (get_all, fields, exclude_fields) for Automations Workflow Emails Get All endpoint #144

Conversation

ye
Copy link
Contributor

@ye ye commented Jul 13, 2017

This should address majority of the issues in #143 and also bump up minor version to 2.0.15.

Verified get_all and fields filter query params with our live mailchimp account which has 37 automation workflow email campaigns, which previously only returns 10 items even though total_items indicates there are more than 10 email campaigns available.

In [1]: import mailchimp3

In [2]: mc = mailchimp3.MailChimp('', 'xxxxxxxx-us1')

In [3]: mc.automations.emails.all('WORKFLOW_ID', get_all=True, exclude_fields='emails,_links')
Out[3]: {'total_items': 37}

In [4]: mc.automations.emails.all('WORKFLOW_ID', get_all=True, fields='emails.settings.title,total_items')
Out[4]: 
{'emails': [{'settings': {'title': 'Week 5'}},
  {'settings': {'title': 'Week 11'}},
  {'settings': {'title': 'Week 29'}},
  {'settings': {'title': 'Week 21'}},
  {'settings': {'title': 'Week 37'}},
  {'settings': {'title': 'Week 23'}},
  {'settings': {'title': 'Week 10'}},
  {'settings': {'title': 'Week 9'}},
  {'settings': {'title': 'Week 30'}},
  {'settings': {'title': 'Week 7'}},
  {'settings': {'title': 'Week 40'}},
  {'settings': {'title': 'Week 33'}},
  {'settings': {'title': 'Week 17'}},
  {'settings': {'title': 'Week 25'}},
  {'settings': {'title': 'Week 31'}},
  {'settings': {'title': 'Week 18'}},
  {'settings': {'title': 'Week 12'}},
  {'settings': {'title': 'Week 4'}},
  {'settings': {'title': 'Week 19'}},
  {'settings': {'title': 'Week 39'}},
  {'settings': {'title': 'Week 28'}},
  {'settings': {'title': 'Week 36'}},
  {'settings': {'title': 'Week 15'}},
  {'settings': {'title': 'Week 27'}},
  {'settings': {'title': 'Week 26'}},
  {'settings': {'title': 'Week 6'}},
  {'settings': {'title': 'Week 35'}},
  {'settings': {'title': 'Week 14'}},
  {'settings': {'title': 'Week 34'}},
  {'settings': {'title': 'Week 13'}},
  {'settings': {'title': 'Week 38'}},
  {'settings': {'title': 'Week 8'}},
  {'settings': {'title': 'Week 24'}},
  {'settings': {'title': 'Week 22'}},
  {'settings': {'title': 'Week 16'}},
  {'settings': {'title': 'Week 32'}},
  {'settings': {'title': 'Week 20'}}],
 'total_items': 37}

In [5]: len(_['emails'])
Out[5]: 37

In [6]: workflow_emails = mc.automations.emails.all('WORKFLOW_ID')

In [7]: len(workflow_emails['emails'])
Out[7]: 10

@stephenross stephenross merged commit cb3db9f into VingtCinq:master Jul 13, 2017
@stephenross
Copy link
Collaborator

@charlesthk Please push the new version to PyPi, thanks

@ye
Copy link
Contributor Author

ye commented Jul 17, 2017

Hi @charlesthk is possible to get this new version update in PyPi this week? Much appreciate it. 🙏

@ye
Copy link
Contributor Author

ye commented Jul 18, 2017

@growth-hacking-paris Awesome! Thank you very much!

@charlesthk
Copy link
Member

charlesthk commented Jul 18, 2017

Hi @ye, sorry I haven't used the right github account for my reply, here I am (@charlesthk).

@ye
Copy link
Contributor Author

ye commented Jul 18, 2017

@charlesthk All good :) I already figured that must be you!

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

Successfully merging this pull request may close these issues.

3 participants