This is a sample app for the HubSpot client libraries. This sample app demonstrates how to authenticate your HubSpot app using OAuth 2.0, and make an API call to the Contacts API.
-
The first steps is to create a HubSpot developer account. This is where you will create and manage HubSpot apps.
-
Next create an app. On the "App info" tab, You will be prompted to fill out some basic information about your app. This includes name, description, logo, etc.
-
Lastly, in the "Auth" tab, you will be provided with a Client ID & Client secret (used in the next step). To ensure your app is compatible with this sample app, set the "Redirect URL" ("http://localhost:3000/oauth-callback" for Node), and select "Contacts" from the "Scopes" list.
-
Copy the .env.template file into a file named .env in the folder of the language you want to use. For example:
cp node/.env.template node/.env
-
Paste your HubSpot Client Id and HubSpot Client Secret as the value for HUBSPOT_CLIENT_ID and HUBSPOT_CLIENT_SECRET in .env
-
Follow the language instructions on how to run. For example, if you want to run the Node server:
cd node # there's a README in this folder with instructions
npm install
npm run dev
HubSpot provides a way to restrict application users access to the system to certain scopes. In order to do that it is a good practice to make a set of scopes required by your application. Please refer to Initiate an Integration with OAuth 2.0 for documentation on the scope parameter passed to https://app.hubspot.com/oauth/authorize to make a set of scopes required. Scopes explains how to make optional scopes and talks about scopes available in HubSpot system