In previous version of MailChimp API there was option to get specific list of members. You was able to send list of emails and get those members.
In version 3.0 there is only option to get ALL members or to get ONE specific members:
/lists/{list_id}/members => get all Members
/lists/{list_id}/members/{subscriber_hash} => get ONE member by Email
So both option is not good. What If I have 100 emails and I want to get that 100 members from my Mailchimp List which have 20k subscribers.
With first option I would need to get all 20k members from the list and then take the 100 which I need? That's bad.
With second option I would need to loop 100 emails and send 100 request to get each member.
Is there any workaround to get list of members querying by multiple emails in v3.0?
In API I can't find filter/query like this neither.
I would make a request to get all the 20k members, and with a simply linq/foreach/filter. With this You will get your 100 members in JSON so I think thats the fastest, and easiest way to do it.
You can use batch operations, but that's almost the same like you loop requests, and harder to get the results and much slower ( need to check the batch is ready what can take several minutes, and wait for it, than get the result url, what will give you a .tar.gz so need to unzip twice, etc) So I think this is a dead idea for "GET" requests.
Related
I am trying to invoke following slack API to fetch private and public channels.
https://api.slack.com/methods/conversations.list
By default as per slack documentation 200 channels are returned at a time when limit is given 1000.
I am passing types= “private_channel,public_channel“ to get the private as well as public channels.
If I pass the types = public_channel with limit 1000 or 9999,
162 channels are returned
If I pass the types= private_channel,public_channel with limit
1000 or 9999,
105 channels are returned
Can anybody please answer same.
With the way pagination works in that API, it's possible to get fewer than the number of results you're asking for, even if there are more results in the total collection to return. You'll need to check if there are additional pages of results and crawl through all of them to build the complete set.
This is because of the way data is retrieved in the back end -- it includes archived data, data of other types -- all the filtering that happens for your result happens after the data is fetched, making additional API calls required to get the next window of data to be filtered and then presented to you.
Here's the relevant documentation:
It's possible to receive fewer results than your specified limit, even when there are additional results to retrieve. Avoid the temptation to check the size of results against the limit to conclude the results have been completely returned. Instead, check the next_cursor value in the response_metadata object to make sure that it's empty, null, or non-existent.
I've got some kind of script. Goal is:
Get Mailchimp Lists
For each list get members
For each member get activity
Store it
Does anyone know - if there any way to not use one API call for each member to get his activity?
I've got around 28 000 members.
28 000 API calls - seems as bad as it can be.
I've tried to get Lists Activity, but no way, it is always empty. So I really have to get exactly members activity.
I'm currently attempting to do something very similar and there is a workaround, although I am not sure how feasible it is. Basically, you can do it through reports, email activity:
http://developer.mailchimp.com/documentation/mailchimp/reference/reports/email-activity/
The challenge here will be that you will try to pull 28.000+ records at a time, therefore it will take a long time. From my brief calculations it can take up to 1 minute per 1000 records (you will need to loop through 1000 records at a time, otherwise it will most likely time out).
The larger problem is maintaining this 'database', if you have activity constantly happening (i.e. opens/clicks/bounces) then you will need to pull the whole campaign activity again and update wherever you store it. I've been trying to find a workaround with no success. You could use the 'since=2017-10-07T00:00:00+00:00' parameter, however it still returns a blank list when there is no activity unfortunately. If only 1000 members are actually active, it will return 27.000 rows of no activity. It would be great if there would be another parameter we could potentially apply to return only emails where there was an action.
Please let me know if you find a better solution.
P.S. - it might be worth reaching out to mailchimp support for this
Update - you can use the Mailchimp Export api: https://developer.mailchimp.com/documentation/mailchimp/guides/how-to-use-the-export-api/ and extract the email activity. I had huge issues unpacking it, please follow the links below: Decode text response from API in Python 3.6 and Separate pd DataFrame Rows that are dictionaries into columns . Let me know if you have any other questions.
I want to get the oldest email in GMail inbox. How can I do that with the minimum number of API calls?
One way to do it could be to get the total number of emails from Users:getProfile API and then use User.messages:list API to get the last page using "pageToken" query parameter by using the formula
pageToken = totalMessages/50
to get the list of messages from the last page of my inbox and then using the mid of the last message in the list to fetch the oldest email.
I am just wondering if there is a better way to do this? I could not figure out other ways to do it from the documentation. Any search filter that will fetch me the oldest email?
User.messages.list contains a paramter called q which can be used for searching.
https://www.googleapis.com/gmail/v1/users/userId/messagesq=before%3A2008%2F01%2F01&access_token={token}
Basicly before:2008/01/01 is sent just like searching in the gmail web app return all the emails before that date.
The trick here will be narrowing down your search. Gmail was released on 2004. Which gives yo possible start between 2018 and 2004 split it in half
before:2011/01/01 (there were mails split it in half again)
before:2007/01/01 (there were no mails must be between 11 and 7)
before:2009/01/01 (...)
There is a term for this method of searching but i cant remember it right now. Basically you keep dividing it by two and finding out where the result must be.
Is there a way to get the members to a certain response of poll without the need to create segments?
I am sending mails and have a poll included (basically participating at an event).
Now I would like to easily collect the respondents for an event from various mails (announcement, invitation, reminder 1, reminder 2,..)
Currently I need to create segments for each response where I need to reference the campaigns individually. So whenever I send a campaign (email) I need to update all segments as there need to be a segment per question, which I would like to avaoid.
Hope thats clear enough.
I had a similar question and after a review of the mailchimp API docs, in particular the reports section I realized there was not a way to retrieve poll results.
After my review, I followed-up with mailchimp and they mentioned access to poll results via API is not available - detailed comments with image attached below:
MailChimp Response - Start
"To be completely honest and transparent, there currently wouldn't be a way of accessing the campaign poll result data directly through the report... With that being said, it would be possible to use the API to create segments based on poll response, then call those segments to view the number of responses for each option, as well as the specific subscribers who chose each individual option.
More info here: https://developer.mailchimp.com/documentation/mailchimp/reference/lists/segments/
MailChimp Response - End
As you can see, although accessing poll results via the API is not available, there is a work around using a method.
Good luck!
I have about 38,000 subscribers in an Interest Group. Using segments I identified around 9,000 subscribers that I'd like to remove from that Interest Group. On the MailChimp website it is incredibly cumbersome to remove them. You can only select a maximum of 100 at a time(only 100 show up on a page before needing to click to the next one). And once you click Actions > Remove from Group they remain in the auto-updating segment making it very difficult to select only the ones you haven't done yet.
Can MailChimp's API let me do this faster?
Yes! MailChimp allows you to send Batch Update queries which you can use to unsubscribe users from the mailing list.
You can use MailChimp's batch endpoints to make a series of PUT requests updating those subscribers fields. So each individual operation would be made against a lists members instance (documented here).