Only get active patrons

I use fetch_page_of_members_from_campaign() in the PHP library. Is there anyway to only get the active patrons? By default, it seems we get all patrons, including the ones you have cancelled their pledges.

I can easily adjust the PHP library, but simply need to know how to filter it to active only. Do we have anything useful in the API?

I dont think that would be possible at this point. However if you add includes to the call, you could get more membership details for each user in that same call and you could speed up processing the data that way since you wont have to query the member for additional details.

How do you mean add includes to speed up the process?

This is how I do it currently:

  1. Get campaign tier ids via fetch_campaign_details().
  2. Get members of campaign via fetch_page_of_members_from_campaign().
  3. And then finally loop through results and fetch each member via fetch_member_details().

Are you telling me there is a way to decrease this workflow and get the same data? Presumably by avoiding looping through each result and get each member via fetch_member_details().

Please share your helpful insights, ideally with code example! I think it will be useful for others as well. Thanks.

Basically you modify the call and add the includes and get the relationships you want, to get info in less calls.Check out how WP plugin does it, starting from below call: