Signing with API Key
HTTP Headers
Authentication of requests is done by sending the following HTTP headers:
RBT-SIGNATURE
: Signature of the request generated with your secret key. It is calculated as hex(HMAC_SHA256(secret, payload)). Read how to generate signatures in the section below.
RBT-API-KEY
: Your API key.
RBT-TS
: A UNIX (in seconds) timestamp after which the request is no longer valid. This is to prevent replay attacks. Only accepts integers.
Note: UNIX timestamps are in seconds. For example, 2018-02-08T04:30:37Z is 1518064237.
Generating Signatures
The signature generated is calculated as hex(HMAC_SHA256(secret, payload_hash)).
Steps to generate a valid signature:
Sort request data params by alphabetical order.
Create a message string by appending data param keys in the format "key1=value1key2=value2key3=value3"
Append unix timestamp to the end of the message string. Example: "key1=value1key2=value2key3=value31696692099"
Get the payload hash by taking the hash of message string using SHA256 encoding.
Signature is '0x'+HEX(HMAC_SHA256(secret, payload_hash))
boolean values are expressed as lowercase "true" or "false".
Example python code:
Last updated