This guide describes how to use special characters in your requests and filters in Modzy. Before diving in, you may want to check out RFC 3986 for generic URI syntax information.
URL encoding
Modzy provides an API that can integrate models in your applications. In order to use it you build requests containing a URL to a specific endpoint and if needed, additional parameters.
URLs include a path component and optionally a query component that is a combination of letters, digits, and separators (hyphens or underscores).
However, there are special characters that either have a special meaning or are different than the character set described above. These characters need to be encoded in order to avoid confusion.
To encode characters replace character by a "%" followed by two-hexadecimal unicode digits (normally UTF-8).
Special characters in path parameters
At this time, no endpoint uses any special character in their path component. The only exception are email addresses that can include special characters as of RFC 6531 which depend on email servers.
Special characters in query parameters
There are several endpoints that support filters with fields that may contain special characters (ex. user or file names) that require encoding.
For example, consider a query in order to get the models deployed by a user called "John Doe"
GET /api/models?createdByFullName=John Doe
is encoded to:
GET /api/model?createdByFullName=John%20Doe
or to:
GET /api/model?createdByFullName=John+Doe
But, if the name is "John González" then it is encoded as:
GET /api/model?createdByFullName=Juan%20Gonz%E1lez
Common characters encoding
The table below shows some common characters as well as their encoding.
Decimal | Character | URL encoding (UTF-8) |
---|---|---|
32 | space | %20 |
35 | # | %23 |
37 | % | %25 |
38 | & | %26 |
43 | + | %2B |
123 | { | %7B |
125 | } | %7D |
225 | á | %E1 |
226 | â | %E2 |
228 | ä | %E4 |
232 | è | %E8 |
233 | é | %E9 |
237 | í | %ED |
238 | î | %EE |
242 | ò | %F2 |
243 | ó | %F3 |
246 | ö | %F6 |
250 | ú | %FA |
251 | û | %FB |
252 | ü | %FC |