URL ENCODING
URL Encoding
This guide explains how Reveal Integration developers can construct valid URLs containing special characters, spaces, or reserved delimiters.
Building a Valid URL
A URL may contain special characters or reserved delimiters (such as ! * ' ( ) ; : @ &) as literal data rather than structural separators.
Percent-encode a character when required by the URL component or endpoint, or when it would otherwise be interpreted as URL syntax.
For ASCII characters, percent-encoding replaces the character with % followed by its two-digit hexadecimal ASCII value.
For non-ASCII text, encode it as UTF-8 first, then percent-encode each resulting byte as %HH.
For example:
API URL - https://api.us.vzconnect.com/cmd/v1/vehicles/1234&1234
Encoded URL - https://api.us.vzconnect.com/cmd/v1/vehicles/1234%261234
Spaces, plus signs, ampersands, and commas
URLs cannot contain unencoded spaces or unencoded reserved characters where they conflict with URL syntax.
Follow these encoding rules:
- Spaces: Use %20 in standard URL paths and query string values. In form-encoded requests (application/x-www-form-urlencoded), serialize spaces as a plus sign (+) (e.g., name=Jane+Doe).
- Plus signs (+): Encode literal plus signs as %2B when form-style query parsing would otherwise interpret + as a space (e.g., name=C%2B%2B for C++).
- Ampersands (&): Encode as %26 when used inside query parameter values to prevent them from acting as parameter separators.
- Commas (,): Encode as %2C when passed inside path or query parameter values if required by the endpoint.
Common percent-encoded characters
Whether a character requires encoding depends on the specific URL component syntax and the API endpoint requirements.
The following are common characters that frequently require percent-encoding when used as data:
| CHARACTER | DESCRIPTION | ENCODED VALUE |
|---|---|---|
| · · | Space | %20 |
| " | Double quote | %22 |
| # | Fragment delimiter | %23 |
| % | Percent sign | %25 |
| | | Pipe | %7C |
| & | Delimiter / Ampersand | %26 |
| - | Hyphen | %2D |
| < | Less-than | %3C |
| > | Greater-than | %3E |
| ( | Left parenthesis | %28 |
| ) | Right parenthesis | %29 |
Note: Unreserved characters such as hyphens (-), underscores (_), periods (.), and tildes (~) do not require percent-encoding according to RFC 3986 standards.
A hyphen (-) is normally allowed in a URL and does not need percent-encoding (%2D). Encode a hyphen only if specific API documentation requires it.
Use of any unsupported characters may result in errors.
Validate a request
Use the Test client to check your URL before sending a request.
Select Encode URL to inspect the encoded version, then confirm that the URL structure and parameter names are unchanged and that only the intended values were encoded.
Always refer to specific endpoint documentation for any additional character restrictions.