question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

hubspot.crm.contacts.exceptions.ApiTypeError: Got an unexpected keyword argument 'id_property' to method get_by_id

See original GitHub issue

Hi 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:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
kiyoqokocommented, May 19, 2022

@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 the id_property is still available: https://github.com/HubSpot/hubspot-api-python/blob/b4147f756bb614dee43a7ba022ac0b6fa26ef91c/hubspot/crm/objects/api/basic_api.py#L279

2reactions
kiyoqokocommented, May 12, 2022

Try the following

api_client.crm.objects.basic_api.get_by_id("contact", "email@example.com", id_property="email")

Read more comments on GitHub >

github_iconTop Results From Across the Web

properties_with_history still available in API V3?
I am trying to retreive the properties history of contacts through API v3. But I got this confusing error. Got an unexpected keyword...
Read more >
Solved: HubSpot Community - Company AssociationsAPI
I'm trying to buid a workflow with custom code that detects when a certain company property has changed and then gives me the...
Read more >
Properties with History - Get /crm/v3/objects/contacts/{contactId}
Hi all, Has anyone had any trouble getting the following error: hubspot.crm.contacts.exceptions.ApiTypeError: Got an unexpected keyword argument.
Read more >
TypeError: Cannot read property 'getById' of undefined when ...
Getting When calling hubspotClient.crm.owners.ownersApi.getById from workflow custom cod get the following error.... TypeError: Cannot read property.
Read more >
Keep getting an undefined promise - HubSpot Community
Solved: Sorry if the question is too simple, but my function keeps getting an ... const apiResponse = await hubspotClient.crm.contacts.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found