email containing a / and subscriptions v1 api

Hello. I’m encountering an issue:

I have a contact with an email containing a slash:

xxx/yyy@zzzzz.com

(yes, it is not common, but according to https://en.wikipedia.org/wiki/Email_address#Local-part it is perfectly valid).

I was able to create the contact in hubspot.

however, when I try to get its bounce status with a GET

https://api.hubapi.com/email/public/v1/subscriptions/xxx/yyy@zzzzz.com

I receive a 404 error sounding like “xxx is not an API endpoint”

The API get with emails without slash works perfectly.

Is there a way to escape the slash, or maybe a v3 api allowing the passing of the email in a json payload?

Hey, @rpiola :waving_hand: Thanks for the fascinating question! Additionally, the Wikipedia article was helpful :raising_hands: I’ll need to reach out to my resources to see about solutions in this case.

One quick question, have you tried using

%2

as an escape for the slash?

Hey, @JBeatty @nikodev @ChrisoKlepke, any thoughts here? Do you like Friday mysteries?:detective:‍

@rpiola, I’ll follow up here with any additional details I find.

Best,

Jaycee

@Jaycee_Lewis, thank you for tagging me on this.

Hey @rpiola,

Thank you for mentioning this, as I was not aware that emails like this are possible. But that’s the great thing about the community. You always learn something.

In short: You might want to use %2F instead of the slash. So for example

steve%2Frogers@avengers.com

I don’t have much experience with the specific endpoint you’re working with, as it is a bit older, I think. However, I’ve tested some requests that way, and it works just fine on any other endpoints, so I see no reason why it shouldn’t work on yours.

If you found this post helpful, consider helping others in the community to find answers faster by marking this as a solution. I’d really appreciate it.

Cheers,

Chriso

Great. It works!