0

I'm trying to pull the details for a contact from hubspot using the recipient's email. I'm using the python3 client "hubspot3" (https://github.com/jpetrucciani/hubspot3).

Here's the code I'm submitting:

import requests
from hubspot3.contacts import ContactsClient

API_KEY=[myapikey]

client=ContactsClient(api_key=API_KEY,debug=True)

email='mytest@gmail.com'

client.get_contact_by_email(email)

The response:

WARNING:root:Too many retries for /contacts/v1/contact/email/nwnippy27+cb1@gmail.com/profile?hapikey=[myapikey]
Traceback (most recent call last):
  File "hubspot_api_test.py", line 11, in <module>
    client.get_contact_by_email(email)
  File "/opt/virtual_env/hubspot-test/lib/python3.7/site-packages/hubspot3/contacts.py", line 38, in get_contact_by_email
    "contact/email/{email}/profile".format(email=email), method="GET", **options
  File "/opt/virtual_env/hubspot-test/lib/python3.7/site-packages/hubspot3/base.py", line 339, in _call
    **options
  File "/opt/virtual_env/hubspot-test/lib/python3.7/site-packages/hubspot3/base.py", line 245, in _call_raw
    result = self._execute_request_raw(connection, request_info)
  File "/opt/virtual_env/hubspot-test/lib/python3.7/site-packages/hubspot3/base.py", line 162, in _execute_request_raw
    raise HubspotNotFound(result, request)
hubspot3.error.HubspotNotFound:
Hubspot Error

I'm reading this error as saying that the email address can't be found. Is that correct? If not, I appreciate any intel on the cause and solution.

Dalton Cézane
  • 3,672
  • 2
  • 35
  • 60
ouonomos
  • 700
  • 1
  • 9
  • 25

1 Answers1

1

OK ... so not super useful, but it turned out that this is just the error message you get when the email doesn't exist. After a few tries it gives up, which is why you get the "too many retries" error.

ouonomos
  • 700
  • 1
  • 9
  • 25