hubspot.crm.contacts.exceptions.ApiTypeError: Got an unexpected keyword argument 'id_property' to method get_by_id
See original GitHub issueHi there 👋
First of, thanks for creating this amazing CRM tool, is fire 🔥
We just updated Python HubSpot API Client on hour backend noticed that our flow broke. Apparently, we have problems retrieving customer data using email.
An email address is the primary unique identifier for a contact in HubSpot. (…) To update a contact via the API, you can use either the contact ID or the contact’s email.
The docs make it seem customer id and email can be used interchangeably, but it does not seem the case anymore. For our use-case we utilized the .get_by_id()
method with the id_property
kwarg, but it seems to have been discontinued.
The idProperty parameter doesn’t appear on the Endpoints tab due to technical limitations, but it can be used for contacts exclusively with email. To use an email address as the unique identifier, set the idProperty as email and enter the email address in place of the contact ID.
We failed to find adequate documentation on python SDK and its usage of idProperty
, getting the error in the issue title instead. The lecture of the codebase makes me believe .get_by_id()
function cannot be used for it, while the HubSpot API in the dashboard does match emails with ids and correctly returns sought object.
Could you please advise me & my colleagues on how exactly to retrieve a contact using email-only?
Cheers! 🍻
Issue Analytics
- State:
- Created a year ago
- Comments:5
@gleberdiniz I understand it has been removed and its most probably a bug, but I am suggesting using
objects.basic_api
as an alternative, where theid_property
is still available: https://github.com/HubSpot/hubspot-api-python/blob/b4147f756bb614dee43a7ba022ac0b6fa26ef91c/hubspot/crm/objects/api/basic_api.py#L279Try the following
api_client.crm.objects.basic_api.get_by_id("contact", "email@example.com", id_property="email")