Yes, it works and I am able to receive secondary emails. But why do I need to use one more API request and use API v1? If there any way to receive ALL user's emails via single request?
I believe this is because secondaryEmail address is not set as a contact property but rather a separate entity.
That said, if you haven't already, I'd recommend jumping over to the HubSpot Ideas Forum and posting this idea there so that it's visible to the HubSpot product team and other HubSpot customers and developers. Hopefully this will gather more interest.
Waste of time, resources and completely obscure - no transparency for the user (me). The idea in software development is that you hide the implementation and expose your interface as simple, nice and user friendly as possible.
This 101 concept again seems to be lost with the HubSpot API.
I believe this is because secondaryEmail address is not set as a contact property but rather a separate entity.
That said, if you haven't already, I'd recommend jumping over to the HubSpot Ideas Forum and posting this idea there so that it's visible to the HubSpot product team and other HubSpot customers and developers. Hopefully this will gather more interest.
Wendy, I know this is an old thread, but your recommended way to get the secondary email is using a version 1 API endpoint for Hubspot which is being sunset in November 2022. Is there a way to get the secondary email for a contact using the V3 API?
I stumbled across this page - and I tried using hs_additional_emails as a property field when retrieving contacts from the API, like &properties=hs_additional_emails - and it will be returned as a contact property. It is not really well documented as this field does not show up in the HS GUI as a contact property.
Don't be fooled - even though the field is named "hs_additional_emails", it seems to return only one additional email address. If a contact has more than two email adresses (which I now know it can have), you might not get all adresses of a contact. So, to get all adresses, you'll have to call a separate endpoint. I hate to say it, but this is very poor API design, unfortunately.
Feb 22, 20234:53 AM - edited Feb 22, 20234:56 AM
Participant
How to fetch contact's all emails with API v3?
SOLVE
I don't think that's true. I am able to get all the emails for a contact inside the hs_additional_emails field. The additional emails are sent as a string separated using a semi-colon ; and using Array methods like hs_additional_emails.split(";"), for JavaScript for example, one can get an array of additional email addresses.
I agree with you on the API design. I tested contacts with multiple email addresses and the "hs_additional_emails" field return them separated by ";". So the data in the field looked like "name1@example.com;name2@example.com".
It's a while that I tested that, I don't think it worked like that when I tested - need to try that out again, thx a lot! Maybe I was confused by this being a string field when expecting an array. Thx a lot!
There is an UGLY workaround described there. How about just making it work so I can get all emails for one contact or search for a contact based on ANY email?