Hello,
I am using the github repo(GitHub - Neos-Metaverse/Patreon.NET: C# / .NET library for working with the Patreon API) to attempt to connect to Patreon using OAuth.
I keep getting the error:
System.NullReferenceException: 'Object reference not set to an instance of an object.'
This exception was originally thrown at this call stack:
Patreon.NET.PatreonClient.GetCampaignMembers(string) in PatreonClient.cs
[External Code]
Testing.Program.Main(string[]) in Program.cs
at line 18 of Testing.cs:
var members = await patreon.GetCampaignMembers(CAMPAIGN_ID);
I know I have the correct token, but I’m not sure how i’d get the Campaign ID…I’m especially not sure how to get the Campaign ID with this repo. If someone could help, i’d greatly appreciate it!
This is the whole code(The library is on the repo for your reference):
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Testing
{
class Program
{
const string CAMPAIGN_ID = "6686780";
const string ACCESS_TOKEN = "XYZ";
static async Task Main(string[] args)
{
var patreon = new Patreon.NET.PatreonClient(ACCESS_TOKEN);
//var pledges = await patreon.GetCampaignPledges(CAMPAIGN_ID);
var members = await patreon.GetCampaignMembers(CAMPAIGN_ID);
var campaign = await patreon.GetCampaign(CAMPAIGN_ID);
Console.WriteLine(patreon);
//Console.WriteLine(members);
Console.WriteLine(campaign);
Console.WriteLine(ACCESS_TOKEN);
Console.Read();
}
}
}
Thank you!