Skip to content

Generation of request signature ​

Overview ​

The hmac-sha256 algorithm is used for encryption, with the apiKey as the key for encryption. The signature is formed as follows:

requestType + param1 + param2 + … + paramN + apiKey

Notice

There is a defined list of parameters for each endpoint. They are listed in the corresponding section.

requestType - type of request (bet, win, balance, etc.)
param1 - 1st parameter
...
paramN - Nth parameter
apiKey - partner’s secret key

Can be helpful

A website for checking the signature

Example ​

Data ​

Parameters:

js
{  
    amount: '10.00',  
    currency: 'USD',  
    partnerId: 1,  
    playerId: '432',  
    roundId: 7562,  
    sessionId: '123',  
    transactionId: 33,
}
apiKeyrequestType
test_keybet

Steps ​

  1. Form string for encryption

bet10.00USD1432756212333test_key

  1. Perform encryption with the key and get the hash

47226afaf96b699b71d1942ede85a6867b668f21f4bb8928db3b52a7410f29aa

Example using NodeJS ​

js
const crypto = require('crypto');

const apiKey = 'test_key';
const result = 'bet10.00USD1432756212333test_key';
const cryptoHash = crypto.createHmac('sha256', apiKey);  

const hash = cryptoHash.update(result).digest('hex');  
console.log(hash);