Encoding Requirements
Byte Data (Signatures & Encrypted Content)
Byte data such as signatures and encrypted content must be Base64-encoded before transmission. When generating a signature, use the base64UrlEncode function: first Base64-encode the signature bytes, then URL-encode (percent-encode) the result so that+, / and = become %2B, %2F and %3D.
Method: base64UrlEncode(bytes) = urlEncode(base64(bytes))
HTTPS URL Data
URLs must be percent-encoded before transmission to handle special characters correctly. Method: URL encoding (percent-encoding)Character Sets
Request Body
- Encoding: UTF-8
- Content-Type:
application/json; charset=UTF-8
Signature Calculation
When calculating signatures, the content to be signed must be properly encoded:1
Construct String
Build the content to be signed:
<HTTP_METHOD> <HTTP_URI>\n<Client-Id>.<Request-Time>.<HTTP_BODY>2
Encode to Bytes
Convert the string to UTF-8 bytes
3
Sign
Apply the SHA256withRSA signature algorithm with your private key
4
base64UrlEncode
Base64-encode the binary signature, then URL-encode the result