Signing API Payloads

Signing API Payloads

To ensure the security and integrity of your API requests to Tylt, each payload must be signed using your API Secret Key. This process generates a unique signature that verifies the authenticity of the request.

Signing a Request

The following steps outline how to sign your API requests:

  1. Retrieve Your API Keys

    You need your API Key and API Secret Key, which should be stored securely. Ensure these keys are kept confidential and are not exposed in client-side code.

  2. Generate the Signature

    You will create a signature using HMAC SHA-256 encryption. This signature will be included in the headers of your API requests.

Example Codes

Here’s how you can sign requests using different programming languages:

// Common function to create HMAC SHA-256 signature
const createSignature = (secret, data) => {
    return crypto.createHmac('sha256', secret)
                 .update(data)
                 .digest('hex');
};

By following these steps and using the provided code examples, you can securely sign your API requests to Tylt, ensuring the integrity and authenticity of your transactions.

Important Considerations

  • Keep Your Keys Secure: Always use environment variables or secure storage for sensitive information like your API Secret Key.

  • Regenerate Keys if Compromised: If your API keys are exposed or compromised, regenerate them immediately and update your secure storage.

Last updated