You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using System;using System.Collections.Generic;using System.Net.Http;using Newtonsoft.Json;classProgram{staticasync System.Threading.Tasks.Task Main(string[]args){// Replace the placeholders with your actual valuesstringcampaignId="your_campaign_id";stringaccessToken="your_access_token";// Define the endpoint URL and headersstringendpoint=$"https://www.patreon.com/api/oauth2/v2/campaigns/{campaignId}/members";HttpClientclient=new HttpClient();
client.DefaultRequestHeaders.Add("Authorization",$"Bearer {accessToken}");// Send the API requestHttpResponseMessageresponse=await client.GetAsync(endpoint);// Parse the response JSON to extract the member datastringresponseContent=await response.Content.ReadAsStringAsync();dynamicjsonResponse= JsonConvert.DeserializeObject(responseContent);List<dynamic>members= jsonResponse.data.ToObject<List<dynamic>>();// Print the member dataforeach(dynamic member in members){decimalpledgeAmount= member.attributes.currently_entitled_amount_cents /100.0m;stringdiscordId= member.attributes.discord_id;
Console.WriteLine($"Discord ID: {discordId}, Pledge Amount: ${pledgeAmount}");}}}
The text was updated successfully, but these errors were encountered:
As artist you can connect your bot profile to your Patreon-Account and also link your patreon tiers to roles on the server.
API-Documentation: https://docs.patreon.com/#user-v2
Sample code:
The text was updated successfully, but these errors were encountered: