APIs & Integrations

VEspo
Top Contributor

Add or Update Contact API ignoring the plus sign

Whenever I try to POST or PATCH the contacts email address field, if the email contains a plus sign (+) HubSpots rejects it as an invalid email even though it's a valid email.  An example would be myname+34@gmail.com

 

How do I get the API to accept these values?

0 Upvotes
3 Replies 3
VEspo
Top Contributor

Add or Update Contact API ignoring the plus sign

Thanks for looking into this.  Here are the values I send ...

 

"PATCH"

"https://api.hubapi.com/crm/v3/objects/contacts/109763230"

"Content-Type", "application/json"

"Authorization", "Bearer " <token>

{"properties": {"email":"myname+34@gmail.com"}}

 

 

Response:

{"status":"error","message":"Property values were not valid: [{\"isValid\":false,\"message\":\"Email address myname 34@gmail.com is invalid\",\"error\":\"INVALID_EMAIL\",\"name\":\"email\"}]","correlationId":"5da89fd2-3375-4892-ad61-49df76b4d84f","category":"VALIDATION_ERROR"}

 

I've tried encoding the + sign, but that just inserts the email address with the encoded values

0 Upvotes
Jaycee_Lewis
Community Manager
Community Manager

Add or Update Contact API ignoring the plus sign

Hey, @VEspo 👋 It looks like the spam filter flagged your reply. I moved it back out. I'll set up another test and follow here.

 

Best,

Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

Jaycee_Lewis
Community Manager
Community Manager

Add or Update Contact API ignoring the plus sign

Hey, @VEspo Can you post an example request and response, please? I want to make sure I am using the same endpoint and request you are using.

 

Best,

Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes