Cannot encode `+` in HTTP Request

I’m creating a HTTP request using 3rd Party Platform.

The request searches for the existence of a contact in Freshdesk using a query string like ?phone=+12345678987

My 3rd Party Platform accepts unencoded URLs and encodes them before making the actual HTTP request. The problem is that it seems to skip the encoding of the + character.

If I try to encode it manually, it double-encodes so %2B becomes %252B

So I can either send an unencoded + or %252B. I assume Freshdesk interprets + as a space.

Given that I cannot change this encoding behaviour, can anyone suggest a workaround, so that Freshdesk API would interpret ‘+’ as a part of my search string?

@Freddy Your thoughts on this

Freddy said: It seems like you’re stuck in a tricky situation due to the 3rd Party Platform’s encoding behavior. One possible workaround is to introduce an intermediary step that takes care of the encoding correctly before sending the HTTP request to Freshdesk.

You can create a small web service (e.g., using AWS Lambda, Google Cloud Functions, or any other serverless platform) that accepts the unencoded URL from your 3rd Party Platform and then properly encodes the URL, specifically handling the + character. Once the URL is encoded correctly with %2B, your service can forward the request to the Freshdesk API.

Alternatively, you can try reaching out to the 3rd Party Platform’s support team and explain the issue. They might be able to address or provide a workaround for the + character encoding issue.