APIs & Integrations

Kyle_Magnuson
Participant

Emails with '+' in them are truncated in response from Get a batch of contacts by email address in Contacts API

SOLVE

When using the' get a batch of contacts by email address' endpoint if emails contained in the response have a '+' in them the email gets truncated in the response.

For example if one of the emails I want contact info for is 'john.doe+test@gmail.com' the email that is returned for John doe in the response is 'test@gmail.com' instead of john.doe+test@gmail.com

Is there another way I can get this contacts full email back in the response form this endpoint? Or is this something that needs to be fixed in Hubspot's api?

1 Accepted solution
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

Emails with '+' in them are truncated in response from Get a batch of contacts by email address in Contacts API

SOLVE

Hi @Kyle_Magnuson,

Can you confirm you're encoding + signs as %2B in your queries?

I was able to successfully pull data for contacts with + in their email address by doing so:

If you don't encode the + signs, HubSpot will search for emails which match the values that follow the sign. In your case, I suspect you have two contacts in your portal. One with john.doe+test@gmail.com and another with just test@gmail.com.

Isaac Takushi

Associate Certification Manager

View solution in original post

0 Upvotes
2 Replies 2
IsaacTakushi
Solution
HubSpot Employee
HubSpot Employee

Emails with '+' in them are truncated in response from Get a batch of contacts by email address in Contacts API

SOLVE

Hi @Kyle_Magnuson,

Can you confirm you're encoding + signs as %2B in your queries?

I was able to successfully pull data for contacts with + in their email address by doing so:

If you don't encode the + signs, HubSpot will search for emails which match the values that follow the sign. In your case, I suspect you have two contacts in your portal. One with john.doe+test@gmail.com and another with just test@gmail.com.

Isaac Takushi

Associate Certification Manager
0 Upvotes
Kyle_Magnuson
Participant

Emails with '+' in them are truncated in response from Get a batch of contacts by email address in Contacts API

SOLVE

Hi, thanks @Isaac_Takushi, encoding the + signs correctly was the issue.

0 Upvotes