hubspot-net / HubSpot.NET

C# .NET Wrapper around the common HubSpot APIs.
MIT License
112 stars 137 forks source link

Endpoint not found and Bearer token not set #121

Open yogigrantz opened 1 year ago

yogigrantz commented 1 year ago

Describe the bug using the API Key provided by HubSpot, I coded like this:

        ` 
        IHubSpotApi hs = new HubSpotApi(hapiKey);

        var contacts = hs.Contact.List();
        foreach (var c in contacts.Contacts)
        {
            Console.WriteLine(c.FirstName);
        }

        var companies = hs.Company.List();
        foreach (var company in companies.Companies)
        {
            Console.WriteLine(company.Name);
        }

    `

Expected behavior I was expecting to see a list of contact first names and company names

Instead, for Contact.List() I was getting 404 page not found, and for Company.List() I was getting unauthorized.

The endpoints that the code was trying to get was: https://api.hubapi.com/contacts/v1/lists/all/contacts/allcount=20 for contacts and https://api.hubapi.com/companies/v2/companies/pagedcount=20 for companies