Request Signature Authentication¶
Each API request must include the standard authentication headers:
X-Api-Key-IdX-SignatureX-Timestamp
The X-Signature value is generated from the HTTP method, request path, raw request body, and Unix timestamp.
Signature Base String¶
Build the signature base string by concatenating these values without separators:
- HTTP method.
- Request path without the scheme, host, or query string.
- Raw request body. For requests without a body, use an empty string.
- Unix epoch timestamp in seconds.
For URLs with query parameters, keep those parameters in the actual request URL, but do not include them in the PATH value used for signature generation.
Example¶
For this request:
The signature base string is:
Generated Headers¶
Postman Example¶
Use a pre-request script to build the signature from the current request.
const secret = "secretKey";
const timestamp = Math.floor(Date.now() / 1000).toString();
const method = pm.request.method.replace(" ", "");
const path = "/" + pm.request.url.path.join("/");
const body = pm.request.body?.raw || "";
const baseString = method + path + body + timestamp;
const signature = CryptoJS
.HmacSHA512(baseString, secret)
.toString(CryptoJS.enc.Base64);
pm.request.headers.upsert({
key: "X-Timestamp",
value: timestamp
});
pm.request.headers.upsert({
key: "X-Signature",
value: signature
});