Skip to content

Code related to the article on writing your own integration vs using Chift

Notifications You must be signed in to change notification settings

chift-oneapi/hubspot_example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hubspot Connector Example

This repository is a quick comparison of the code needed to achieve a simple use case with a Hubspot integration. One is done using the requests library, illustrating how a developer would go about it and the other one is done using the platform Chift.

How to start the connector app

Creating your .env file:

HUBSPOT_CLIENT_ID=<hubspot_client_id>
HUBSPOT_CLIENT_SECRET=<hubspot_client_secret>
HUBSPOT_SCOPE=oauth crm.objects.contacts.read crm.objects.companies.read
HUBSPOT_REDIRECT_URI=http://localhost:8000/callback

HUBSPOT_URL=https://app.hubspot.com
HUBSPOT_TOKEN_URL=https://api.hubapi.com/oauth/v1/token
HUBSPOT_API_URL=https://api.hubapi.com/crm/v3/objects
uv sync
uv run fastapi src/connector/main.py

It should now be accessible through your browser.

Starting the OAuth2 flow can be done through accessing the following URL:

http://localhost:8000/auth

Supported calls:

curl http://localhost:8000/contacts
curl http://localhost:8000/refresh-token?token=<your_refresh_token>

Using the unified api script

Creating your .env

CHIFT_CLIENT_ID=<chift_client_id>
CHIFT_CLIENT_SECRET=<chift_client_secret>
CHIFT_ACCOUNT_ID=<chift_client_account_id>
CHIFT_URL=https://api.chift.eu
CHIFT_CONSUMER_ID=<your_consumer_id>

Executing the code

uv run python src/unified_api/main.py

About

Code related to the article on writing your own integration vs using Chift

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages