v1
Authentication
Insights API v1 supports Basic Authentication and Bearer HMAC Authentication. Use the method provisioned for your integration.
Basic Authentication
Send these headers:
| Header | Value |
|---|---|
Authorization | Basic <Base64(username:password)> |
Merchant-Key | Merchant key provided by Privy |
Content-Type | application/json |
Code
Bearer HMAC Authentication
Send these headers:
| Header | Value |
|---|---|
Authorization | Bearer <access-token> |
Content-Type | application/json |
Timestamp | Request timestamp used to generate the signature |
Signature | Base64-encoded client ID and HMAC signature |
Build the signature as follows:
- Remove spaces, line breaks, and backslashes from the JSON request body.
- Calculate the MD5 digest of the resulting body and encode the digest as Base64.
- Join
Timestamp, client ID, HTTP method, and the Base64 MD5 value with colons:timestamp:client_id:POST:body_md5_base64. - Calculate HMAC-SHA256 using the client secret, then encode the result as Base64.
- Build
#client_id:#hmac_base64and Base64-encode that complete value for theSignatureheader.
Code
Keep all credentials and signing secrets on your server. Never expose them in browser or mobile application code.
Last modified on
