I'm new to HubSpot API and I'm having a hard time with the most basic of things, authentication. I currently have 2 Azure Functions running in my environment. The first is a simple WebHook that's registered in HubSpot. The app triggers my webhook whenever the appropriately defined subscription is hit. That all works, my second trigger pulls the newly created queue item and I want to use the Id stored from HubSpot to pull in additional fields, like email if a contact, etc... Any ways, I can't seem to properly format my HttpClient object because I keep getting errors galore.
I then went to Postman and tested the entire process there. After finally resolving the BAD_REDIRECT_URI problem that kept persisting I was able to create a code from my HubSpot Client Id, Client Secret, Redirect Uri, and of course setting the grant_type=authorization_code. I then in turn used the returned code to successfully create an access_token and a refresh_token. So i know it all works as a 2 step process. However, I can't seem to yield the same results in my Azure Function.
Is there anyone out there that can help me using C# and Azure? I read somewhere on this site that HubSpot actually states to just use the HAPIkey instead of the Client Id and Client Secret, while some have stated that this isn't possible when trying to access some parts of the API....help?