Skip to content

API transform

Manuel Strehl edited this page Aug 2, 2013 · 2 revisions

Transform a String

e.g. , to upper-case, NFC, NFD, …

Template for this request:

http://codepoints.net/api/v1/transform/{action}/{data}{?callback}

where {action} is a transformation and {data} is an UTF-8 encoded string. {?callback} is an optional callback function name to perform a JSON-P request. Possible actions can be queried by omitting {action} and {data} and examining the actions field of the responded JSON object.

Response

The response is a JSON string transformed by the requested action. The following request

/api/v1/transform/upper/abcde

is responded with the JSON string

    "ABCDE"

The actions nfc, nfd, nfkc and nfkd are currently implemented by using PHP’s Normalizer API. This means unfortunately, that codepoints added since version 6.0 will not be handled correctly. You can track this issue to be notified, when this is fixed.

Possible Errors

  1. 414 Request URI too Long: When {data} exceeds the maximum length (1024 codepoints at the moment).
  2. 400 Bad Request: When an unknown property appears.
  3. 500 Server Error: When for some reason the SQL query for filtering fails. Please open a ticket in this case, so we can handle such an error.
Clone this wiki locally