hubspot3客户端和“太多重试”错误

时间:2018-11-05 19:30:21

标签: python hubspot

我正在尝试使用收件人的电子邮件从hubspot中提取联系人的详细信息。我正在使用python3客户端“ hubspot3”(https://github.com/jpetrucciani/hubspot3)。

这是我要提交的代码:

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)

响应:

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

我读此错误是因为找不到电子邮件地址。那是对的吗?如果没有,我将感谢您对原因和解决方案的理解。

1 个答案:

答案 0 :(得分:1)

好的...不是超级有用,但是事实证明,这只是当电子邮件不存在时收到的错误消息。经过几次尝试后,它放弃了,这就是为什么您遇到“太多重试”错误的原因。