How to get tiers of my patrons


#1

I am able to get patrons by calling this url but in the response I see only ids of users and ids of tiers
curl -X GET https://api.patreon.com/oauth2/v2/campaigns/<my_campaign_id>/members?include=currently_entitled_tiers -H 'Authorization: Bearer <mysecret>'

{"data":[{"attributes":{},"id":"<member_id>","relationships":{"currently_entitled_tiers":{"data":[{"id":"3270812","type":"tier"}]}},"type":"member"}],"included":[{"attributes":{},"id":"3270812","type":"tier"}],"meta":{"pagination":{"total":1}}}

When I try to get list of my tiers with names, I still get just IDs without names

curl -X GET https://api.patreon.com/oauth2/v2/campaigns?include=tiers -H 'Authorization: Bearer <mysecret>'

can you give me any hint how to get some useful list where I can match if user is member of some tier ?


#2

Hey there! Currently, there’s no easy way to get all the members of a tier. We recommend fetching all the members for a campaign, then filtering in code down to just the members you want.


#3

thanks but how exactly achieve it?
it looks every time I request some nested value, I still get just IDs
for example if I run campaigns?include=tiers&fields[tier]=title I dont get any tier names
can you please point me what am I doing wrong?


#4

ok I finally found it, maybe this will help somebody else

https://api.patreon.com/oauth2/v2/campaigns/<campaign_id>/members?include=currently_entitled_tiers&fields[tier]=title&fields[member]=email

this url gets all patrons for the campaign with their tier IDs and also tiers with their names