Get Contact Email by Email

contacts

#1

Hi,

I’m currently trying to get a contact’s vid by email, so I can later add deals if required and link them up.

I’m using the demo HubSpot account and have added a contact (philtest@test.com). As I only want a vid, I’m passing the &property=vid in the URL like so:
https://api.hubapi.com/contacts/v1/contact/email/philtest@test.com/profile?hapikey=demo&property=vid&propertyMode=value_only

This however still returns the full contact. Is there any way to pull back just the vid?


#2

@Phil When I make this call I don’t get any of the properties back and just the vid at the top of the object returned. You will still receive the other information as a FYI no matter what. getting a response of just {vid: xxx} is not possible. The call above seems to be working properly though.


#3

Thanks - I think I misunderstood how it would function; I assumed I could specify any of the JSON object property names to get it back (Not just the Properties collection).

It was more to shave off a few ms when parsing to object in .NET.

Thanks for the quick reply.


#4

Hi @pmanca, thanks for contributing your answer to @Phil’s question.

So, it sounds like getting vid: xxx is not possible as a single isolated value to call up with the API, is that right?

I’d like to treat vid as a contact property if possible and map vid back to SFDC to check existence of a contact in HS before taking certain actions in SFDC. So, basically I need some kind of value in SFDC that says yes/no this is a syncing contact.

Thanks in advance for any insights you can shed here.


#5

@ronkagan

Why would you need it back as a single isolated value?(other then it would be slightly easier to handle)

You just need to grab the value out of the object that is returned from HubSpot. If you’d like to map it to SFDC you absolutely can.


#6

Thanks @pmanca – I should perhaps clarify that I am not much of a coder, so, what might be obvious here may be lost on me.

Why would you need it back as a single isolated value?

The goal here is to store in SFDC the unique identifying value of the object in HS with which a contact record is syncing. So, just storing that single isolated value seems to me to be the best solution for that.

One use case is as follows:
SFDC logic is implemented whereby before an SFDC user is allowed to sign a contact for a free trial, SFDC looks and verifies that the same contact exists in HubSpot, which is essential since HS will be the marketing automation tool to send the trialing contact emails warning them of the expiring trial and asking them to upgrade to premium / paid.

Hope that is helpful. Again, if you have any advice, please let me know.


#7

@ronkagan Yep, that all makes sense. I would do some research on how to parse JSON as that is what the API returns. Hopefully this can be a good exercise to improve your coding skills.


#8

Thanks, @pmanca – I’ve used blockspring to parse JSON – the question here I think is what the next step is in populating my sfdc instance with the vid advice on how to proceed would be most welcome


#9

@ronkagan The execution of that will really be up to you and your team. You might want to think about how often do you want it to update? Maybe you can have a script that runs every night to hit the HubSpot API take the information and then push it over to SFDC through their APIs.


#10

@pmanca that sounds good. What would the next step be to implement that script?