Last active
July 16, 2021 16:13
-
-
Save jjeanjacques10/901cc788e7537e858185842fc5bb236d to your computer and use it in GitHub Desktop.
HubSpot Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
HUBSPOT_API_KEY = '<HUBSPOT_API_KEY>' | |
def post_contact(data): | |
url = 'https://api.hubapi.com/crm/v3/objects/contacts?hapikey=' + HUBSPOT_API_KEY | |
headers = { | |
'Content-Type': 'application/json' | |
} | |
response = requests.post(url, json=data, headers=headers) | |
print(response.status_code) | |
print(response.text) | |
def get_access_limit(): | |
url = 'https://api.hubapi.com/integrations/v1/limit/daily?hapikey=' + HUBSPOT_API_KEY | |
headers = { | |
'content-type': 'application/json' | |
} | |
response = requests.get(url, headers=headers) | |
print(response.status_code) | |
print(response.text) | |
get_access_limit() | |
post_contact({ "properties": { "firstname": "John", "lastname": "Doe", "email": "[email protected]", "phone": "1-234-567-890" } }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment