Invalid prospect email address at Pardot Salesfoce

793 Views Asked by At

I am trying to create a prospect at Pardot- Salesforce from the python API with this format :

{'brand': 'brand1', 'platform': 'Platform 1', 'email': '[email protected]', 'first_name': 'Test', 'last_name': 'User39', 'addr_country': 'United Kingdom', 'opt_in': True}

I am getting this error :

Invalid prospect email address

This is obviously because of the email's format , but according to this official article that the character "+" is an allowed character for the email field.

So any idea what could be wrong ?

2

There are 2 best solutions below

0
On

I was spending a lot of time on this as well but you will need to encode the + symbol to the html encoding%2B for it to work... super annoying that it is not in the documentation... For encoding you can use the website below https://www.url-encode-decode.com/

0
On

you can encode the whole email portion and send it to the API call.. Pardot on its backend did the decode for the special characters and saving to its original email state

for example: Urlencode(test.12+{}[email protected]) and pass it to the API-> it works.. sample API call after encoding the email /4/do/create/email/test.12%21%23%24%25%26%27*%2F%3D%3F%5E_%2B-%60%7B%7C%7D%7E3%40gmail.com?format=json