Currently, there are two ways of knowing if a patron has pledged to one’s own campaign:
- They have authenticated with OAuth2 and you query the API with their bearer token
- You page through a list of ALL patrons with a pledge to your campaign. In my particular case, this takes almost 30 seconds and growing. This kind of wait would be a disaster for my UX every time I try to verify a patron’s status. This list would need to be frequent purged from the cache for users who are trying to sort out their payment.
The first method requires the user to have authenticated with the OAuth2 API. In my particular case, this is not viable. I already have many patrons authenticated for their perks manually. Furthermore, it appears some of my refresh tokens are starting to become invalid (perhaps a mistake of mine, but still leaves me without bearers for these users).
My current system uses method #1 with method #2 as a fallback, but this system doesn’t work reliably yet for me to use in production. Furthermore, as a developer, it is difficult to implement both methods as they each have wildly different outputs.
Proposal
The user’s information can be retrieved with this endpoint:
GET https://api.patreon.com/oauth2/api/current_user
One solution would be to add an endpoint that takes the user’s id as part of the route:
GET https://api.patreon.com/oauth2/api/user/:userid
Eg like:
GET https://api.patreon.com/oauth2/api/user/2803040
This new endpoint would only require the creator access token.