APIs & Integrations

ogroendal
Participant

idProperty only accepts email in new API when getting a contact

I am using the new API and I am running into a weird error.

 

When using

GET
/crm/v3/objects/contacts/{contactId}

We can give an idProperty, which the new API docs describe like so : "The name of a property whose values are unique for this object type".

 

I have create a new custom property and marked it as being unique, but when I try to search using this new custom  property I get the following error response:

"Contacts may only be looked up by 'email' as part of a unique property value request.".

 

Is the documentation wrong or am I misunderstanding the error response? Seems like I can only really search for the internal hubspot ID or email but it would very useful to search for a custom ID, and the documentation seems to indicate that you can so I would like some guidance on this.

 

Thanks in advance!

 

10 Replies 10
EvanjmDavies
Participant | Diamond Partner
Participant | Diamond Partner

idProperty only accepts email in new API when getting a contact

I too am having the same issue as mathiasconradt

0 Upvotes
mathiasconradt
Member

idProperty only accepts email in new API when getting a contact


I have create a new custom property and marked it as being unique,


Where in the UI do you mark a custom attribute as unique? When I create a custom contact property via the UI as below, I don't have such option, I can only set name and input field type (i.e. single line).

 

2021-12-08_13-42.png

 

I read the article posted by @WendyGoh above (CRM API | Understanding the CRM) but it does not mention any uniqueness flag.

Wondering though, the article says:

 


If you have an Enterprise subscription, for text-input field types, select the Allow users to search for information entered to this field checkbox and number field types to allow text or a numeric value in the property to be searchable across objects in the global search bar

Does it mean, it only works with the API in an Enterprise subscription and not with a Starter Plan as well?

 

When I try to get a contact by custom property, it still fails with that error as in the original post.

 

2021-12-08_13-52.png

 

DattaGroover
Participant

idProperty only accepts email in new API when getting a contact

Thanks @WendyGoh, much aooreciated.

0 Upvotes
ogroendal
Participant

idProperty only accepts email in new API when getting a contact

Hey @WendyGoh thanks for updating this thread when the feature was announced, that is some first class support!

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

idProperty only accepts email in new API when getting a contact

Hey @DattaGroover @ogroendal,

 

This function is fully live and you can learn more about it on the CRM API | Understanding the CRM

 

Do let me know if you've any questions around this. Happy to help clarify 🙂 

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

idProperty only accepts email in new API when getting a contact

Hey @ogroendal,

 

Sincere apologise on the delayed in response. 

 

I'm still checking in with our internal team on this and I'll keep you posted here as soon as I receive updates on it. 

DattaGroover
Participant

idProperty only accepts email in new API when getting a contact

Any update on that, Wendy?

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

idProperty only accepts email in new API when getting a contact

Hey @DattaGroover,

 

I'm still checking this with the team. I believe for the time being, this function is still currently work in progress but I'll keep you all updated on this forum thread once I have the confirmation. 

0 Upvotes
DattaGroover
Participant

idProperty only accepts email in new API when getting a contact

I guess I should assume WIP

0 Upvotes
ogroendal
Participant

idProperty only accepts email in new API when getting a contact

Hey Wendy.

 

I worked around by using the search functionality, but it just seems like a practical idea that would be great to have. (Or at least clarify the documentation if this wont be possible).

 

Thanks.