hubspot3 client and “too many retries” error

北城余情 提交于 2021-01-29 14:54:46

问题


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.


回答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.



来源:https://stackoverflow.com/questions/53160962/hubspot3-client-and-too-many-retries-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!