File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ using Patreon.Api;
2525
2626public class MyService (IPatreonApi patreonApi )
2727{
28+ // Get the active tier ids for a user based on your campaign id
2829 public async Task GetTiers ()
2930 {
3031 AuthorizationTokens tokens = new ()
@@ -45,6 +46,31 @@ public class MyService(IPatreonApi patreonApi)
4546
4647 IReadOnlyList < string > ? tiers = response .GetTierIds (" your-campaign-id" );
4748 }
49+
50+ // Manually refreshing the access + refresh tokens using a user refresh token and your client id + secret
51+ public async Task ManualTokenRefresh ()
52+ {
53+ PatreonTokenResponse response = await patreonApi .GetToken (
54+ PatreonTokenRequest .FromRefreshToken (
55+ authTokens .RefreshToken ,
56+ " your-client-id" ,
57+ " your-client-secret"
58+ )
59+ );
60+ }
61+
62+ // Getting access + refresh tokens using a code from the Patreon OAuth2 flow
63+ public async Task GetTokensFromCode (string code )
64+ {
65+ PatreonTokenResponse response = await patreonApi .GetToken (
66+ PatreonTokenRequest .FromCode (
67+ code ,
68+ " your-client-id" ,
69+ " your-client-secret" ,
70+ " your-redirect-uri"
71+ )
72+ );
73+ }
4874}
4975```
5076
You can’t perform that action at this time.
0 commit comments