HMAC Signature

Generate HMAC signature for consumer_id using your API key as the secret for secure authentication.

Endpoint

POST/hmacSignature
Generate a cryptographically secure HMAC signature for a consumer_id using SHA256 algorithm with your API key as the secret.
https://chat-api.atriai.chat/hmacSignature

Authentication

Type:
Bearer Token
Header:
Authorization
Your project-specific API key for the Chat service (also used as HMAC secret)

Request Parameters

The request body should contain a JSON object with the following parameters:

Request Body Parameters

consumer_idstringREQUIRED

The consumer identifier to generate an HMAC signature for

Validation Rules

The following validation rules apply to the request:

consumer_id is required

The consumer_id parameter must be provided and cannot be empty

Valid API key required

A valid API key must be provided in the Authorization header as it serves as the HMAC secret

Response Schema

The API returns a JSON object with the following structure:

consumer_idstring

The consumer identifier that was signed

hmac_signaturestring

The generated HMAC-SHA256 signature in hexadecimal format

Usage Examples

Common usage patterns for the HMAC Signature endpoint:

Generate HMAC for Consumer

Generate a secure signature for consumer authentication

{
  "consumer_id": "user_12345"
}

Response Example

Example response for a successful HMAC signature generation:

{
  "consumer_id": "user_12345",
  "hmac_signature": "a8b2c3d4e5f6789012345abcdef67890123456789abcdef0123456789abcdef01"
}

Security Notes

Important security considerations when using HMAC signatures:

  • The API key serves as both authentication and HMAC secret
  • HMAC signatures provide cryptographic proof of message integrity and are used to verify consumer authenticity
  • Keep your API key secure and do not expose them in client side code as it's used to generate signatures

Try it out

Select a language to see how to make a request to the API

C
cURL Request
curl -L 'https://chat-api.atriai.chat/hmacSignature' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "consumer_id": "your_consumer_id_here"
  }'
!

Token Required

Replace YOUR_API_KEY with your actual token to authenticate requests.