Skip to main content
Solved

Query the '/v1/customers?email=' with email that contains '+' sign


Hi Team,

I integrated the backend with Customer.io and it’s working fine except for some corner cases.

We have some customers with non-standard emails - their emails contain a ‘+’ sign.
The API, which I’m using in the backend, https://api.customer.io/v1/customers?email= doesn’t retrieve existing customers.
I’ve tried to apply encoding to the URI, and even partially encoding applied only to the ‘+’ sign, but the result was not successful.
Examples: 

test+test@test.com
test%2Btest%40test.com 
test%2Btest@test.com

The interface the customer accessible via https://fly.customer.io/workspaces/<workspace_id>/journeys/people?email=test%2Btest%40test.com

and the email is fully encoded.

I hope we soon find a solution,
Thank you

Best answer by Byron

Hi Alexey,

 

This is Byron from the technical support team. Great question! I did a little testing using cURL and Postman and was able to retrieve results from both by encoding the `+` symbol in the request with `%2B`. I see you mentioned that you tried that without success, so we may need a little more information about the full request you sent.

 

cURL:

curl --request GET \   --url 'https://api.customer.io/v1/customers?email=byron%2Btest@customer.io' \   --header 'Authorization: Bearer <myToken>'

 

Returns:

{"results":[{"email":"byron+test@customer.io","id":"testid","cio_id":"f8e50600fee501ffe501"}]

 

 

Postman:

GET https://api.customer.io/v1/customers?email=byron%2Btest@customer.io

 

Returns:

{   "results": [     {       "email": "byron+test@customer.io",       "id": "testid",       "cio_id": "f8e50643443201ffe501"     }   ] }

 

I also tested encoding `@` to `%40` and that also worked for both cURL and Postman.

View original
Did this topic help you find an answer to your question?

2 replies

Byron
  • 68 replies
  • Answer
  • October 25, 2023

Hi Alexey,

 

This is Byron from the technical support team. Great question! I did a little testing using cURL and Postman and was able to retrieve results from both by encoding the `+` symbol in the request with `%2B`. I see you mentioned that you tried that without success, so we may need a little more information about the full request you sent.

 

cURL:

curl --request GET \   --url 'https://api.customer.io/v1/customers?email=byron%2Btest@customer.io' \   --header 'Authorization: Bearer <myToken>'

 

Returns:

{"results":[{"email":"byron+test@customer.io","id":"testid","cio_id":"f8e50600fee501ffe501"}]

 

 

Postman:

GET https://api.customer.io/v1/customers?email=byron%2Btest@customer.io

 

Returns:

{   "results": [     {       "email": "byron+test@customer.io",       "id": "testid",       "cio_id": "f8e50643443201ffe501"     }   ] }

 

I also tested encoding `@` to `%40` and that also worked for both cURL and Postman.


Hi Byron,

Wow, the `curl` works fine with encoding the `+`,
Let me figure out what’s wrong with Spring RestTemplate (Java)

Thank you so much for your quick response!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings