generateSignature() method and pass in the HTTP method, request path, timestamp, nonce, and the original JSON body.encryptBody() method and pass in the original JSON, App ID, and apiDataKey.sortQueryString() method to sort query parameters.generateNonce() method to generate a random string.X-Enc = aes-gcm-v1 is enabled).apiDataKey must be a Base64-encoded 32-byte key.Content-Type: use application/octet-stream for encrypted payloads and application/json for plaintext payloads.openssl_encrypt() fills the $tag parameter with a 16-byte authentication tag (authTag).