Calven
  1. HMAC Authentication
Calven
  • Overview
  • Key Access Levels
  • Basic Authentication Overview
  • HMAC Authentication Overview
  • SDKs
  • Calven Data Models
  • HMAC Authentication
    • Generate a token with an API key and HMAC
      POST
    • Generate a token with an API key and client secret
      POST
  • Presence
    • Presence Overview
    • Submit presence events with BASIC auth
      POST
    • Submit presence events
      POST
  • Occupancy
    • Occupancy Overview
    • Submit occupancy events
      POST
  • Time off
    • Submit time off updates
      POST
  • Access Credentials
    • Submit access credentials
      POST
  • Warehouse - Basic Auth
    • Warehouse Overview
    • Users
      GET
    • Locations
      GET
    • Desks
      GET
    • Bookings & Attendance
      GET
    • Presence Details
      GET
    • User Actions Log
      GET
  • Warehouse - HMAC Auth
    • Warehouse Overview
    • Users
      GET
    • Locations
      GET
    • Desks
      GET
    • Bookings & Attendance
      GET
    • Presence
      GET
    • User Actions Log
      GET
  1. HMAC Authentication

Generate a token with an API key and HMAC

POST
/v1/auth
auth
Generate a token with an API key and HMACSHA256.

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Body Params application/json
apiKey
string 
required
The APIKey ID for which a token is requested
timestamp
number 
required
The current unix epoch time stamp serves as a validation mechanism to ensure the integrity and validity of the request
Example:
1711062317
hash
string 
required

The HMAC-SHA256 hash generated from the string +timestamp using the api key secret

Example
{
    "apiKey": "string",
    "timestamp": 1711062317,
    "hash": "string"
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.calven.com/v1/auth' \
--header 'Content-Type: application/json' \
--data-raw '{
    "apiKey": "string",
    "timestamp": 1711062317,
    "hash": "string"
}'

Responses

🟢200Success
application/json
Body
authenticated
boolean 
required
Indicates success or failure of the authentication request
message
string 
required
The message associated with the authentication request
token
string 
required
JWT token that can be used for making authorized subsequent requests
expiration
number 
required
Unix timestamp of the token expiration
Example
{
    "authenticated": true,
    "message": "string",
    "token": "string",
    "expiration": 0
}
🟠400400
🟠401Payload when auth header is missing or invalid
Previous
Calven Data Models
Next
Generate a token with an API key and client secret
Built with