hubspot-net / HubSpot.NET

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

HubSpotOAuthApi Authorize and Refresh Methods Return Null Token with Valid Input #102

Open mdbrooks48 opened 3 years ago

mdbrooks48 commented 3 years ago

Describe the bug The HubSpotOAuthApi Authorize and Refresh methods return null with valid authorization codes and refresh token values. The root cause is that RestSharp is returning UnsupportedMediaType (415) response code.

Repro Steps Steps to reproduce the behavior:

  1. Get a valid Authorization code or Refresh Token (via Postman).
  2. Create an instance of HubSpotApi with valid ClientId, Client Secret, and App Ids for a HubSpot Application.
  3. Call Authorize with the Authorization Code or Refresh with a valid Refresh Token (or a new instance of HubSpotToken with a RefreshToken property with a valid Refresh Token).

Expected behavior A valid HubSpotToken with the RefreshToken and AccessToken properties populated