Hi. I'm struggling to find a way to search for subscribers within a list, or within the recipients of a campaign.
For example, I load a campaign and display it's recipients in a list along with the actions those recipients took (opens, clicks, etc). I want to add a search box so that my users can filter the list of recipients based on the term entered. The get_recipients method (for campaigns) and get_active_subscribers method (for lists) do not include a search term parameter, so the only way I can see to do it is to load the recipients into an array and search it in my code, locally. The maximum result page size is 999, so if the list is larger (which many are) it means loading a page and searching the results, then loading another, then another, each time checking the result set for the entered term. This is obviously not a great way to achieve a simple search result set!
Am I missing something?
You can search a list for specific subscriber by using the Getting a subscribers's details method. However, that won't give you that subscribers campaign statistics (ie. opens, clicks etc) for any campaign.
Unfortunately, there is no easy way to get a recipients statistics for a specific campaign. You'll have to use the Campaign opens and Campaign clicks methods to get the stats for every recipient, and do a search on that. You should be able to specify the maximum page size, it doesn't have to be 999 or 1000. You could then specify a large number so that you only get 1 page (though there will probably be problems associated with that, due to the nature of the size of the result set)
I hope that answers your question. Sorry I couldn't be much more help.
I'd suggest that a better solution to this is to actually get the subscriber's history, then find the history entry for the campaign ID you need. The Actions field will contain all actions the subscriber has taken for the given campaign.
From Australia to Zimbabwe, and everywhere in between, companies count on Campaign Monitor for email campaigns that drive real business results.Get started for free