Most Variational API calls require the request to be authenticated by an HMAC-SHA256 signature generated using an API Key and an API Secret. You can obtain those by generating API credentials for your company in the UI's settings pages.
Required Headers
All requests to Variational API endpoints requiring authentication must include 3 headers:
X-Request-Timestamp-Ms: Unix timestamp of the request (in milliseconds)
X-Variational-Key: client API key
X-Variational-Signature: a signature derived from the timestamp, client API key, secret, some of the request parameters and payload
For security, we require that the timestamp you specify on the request does not differ from the current time on our API servers by more than 5 seconds.
You can access the Variational API server time using the /status endpoint:
https://api.testnet.variational.io/v1/status (doesn't require authentication)
Generating a Signature
A signature is generated by writing an authentication message to a byte buffer and signing it with HMAC-SHA256. The message is an ascii-encoded string consisting of the following values divided by pipe | symbols:
For endpoints expecting a request payload, the exact bytes of the HTTP request body must be appended to the authentication message buffer following another pipe symbol: