DonorDrive / PublicAPI

Documentation and Examples for the DonorDrive Public API
MIT License
37 stars 12 forks source link

Team API endpoint for number of team members #16

Closed djotaku closed 5 years ago

djotaku commented 5 years ago

It's possible I'm missing something, but when I look at https://www.extra-life.org/api/teams/44013 I don't see a way of knowing how many team members are on the team. If I go to https://extra-life.org/api/teams/44013/participants I could check if there are 100 and that would tell me that MAYBE there are 101, but it'd be easier if I could know ahead of time.

Thanks!

Zosoled commented 5 years ago

Use the Num-Records response header from the team participants endpoint. https://github.com/DonorDrive/PublicAPI/tree/master/docs/1.0

timmixell commented 5 years ago

Num-Records is a great way to get that info if you're already pulling participants. I think there's value adding it to the team endpoint as well. I'm gonna knock this out as soon as I can. Keep being awesome, EL community! ♥️

djotaku commented 5 years ago

Cool! I will use Num-Records for now (took a bit to figure out it's returned as an email.message.message type in python and then how to read that. But I can at least get that number for now and use that to iterate in order to find the top X participants on a team.

By the way, if you want to see what I'm doing w/ the API -> https://github.com/djotaku/ELDonationTracker

timmixell commented 5 years ago

I've got internal commits PR'ed. The update here will reflect what you'll see on the consumer-end when this ships. Pretty straightforward?

djotaku commented 5 years ago

excited

timmixell commented 5 years ago

this is now live!