Skip to content

Instantly share code, notes, and snippets.

@jjeanjacques10
Last active July 16, 2021 16:13
Show Gist options
  • Save jjeanjacques10/901cc788e7537e858185842fc5bb236d to your computer and use it in GitHub Desktop.
Save jjeanjacques10/901cc788e7537e858185842fc5bb236d to your computer and use it in GitHub Desktop.
HubSpot Python
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": "bcooper@biglytics.net", "phone": "1-234-567-890" } })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment