Convert our api integration using API key to 0Auth 2.0
SOLVE
I have implemented many integrations with hubspot API using api key (less secure) approach, for example inside my asp.net c# application i have the following code to integrate with hubspot api to get the companies:-
I've found a resource here that may assist, take a look here. This documents a .NET wrapper and runs through how to make the authentication request using OAuth.
Convert our api integration using API key to 0Auth 2.0
SOLVE
Hi JohnJohn,
OAuth involves more than just tweaking the existing API request. You need to get an access token from HubSpot that you can include in the header of your API requests. To do this you need to go through a multipart handshake in which you request a token and a secret for a given set of scopes, and provide a callback. Then you send the user to HubSpot so they can auth and your callback gets called when they are done. Then you use the authorization code you get back to request an access token which you use to validate API requests. You will also need to manage keeping the token refreshed.
This is why people usually prefer to use a wrapper that handles all of this for them. For example, I've had success with JSO.
If you want to roll it yourself, that's also feasible but it's a bit of work. I recommend starting with Digital Ocean's guide on Oauth2.
I've found a resource here that may assist, take a look here. This documents a .NET wrapper and runs through how to make the authentication request using OAuth.
Convert our api integration using API key to 0Auth 2.0
SOLVE
Hi JohnJohn,
OAuth involves more than just tweaking the existing API request. You need to get an access token from HubSpot that you can include in the header of your API requests. To do this you need to go through a multipart handshake in which you request a token and a secret for a given set of scopes, and provide a callback. Then you send the user to HubSpot so they can auth and your callback gets called when they are done. Then you use the authorization code you get back to request an access token which you use to validate API requests. You will also need to manage keeping the token refreshed.
This is why people usually prefer to use a wrapper that handles all of this for them. For example, I've had success with JSO.
If you want to roll it yourself, that's also feasible but it's a bit of work. I recommend starting with Digital Ocean's guide on Oauth2.