- Go to your account on whitebit.com.
- Click on the API keys tab.
- Select the web-hook configuration tab for your API keys.
- Paste correct URI to your web server which will process web-hook calls.
- Press Generate a new key button and toggle the activation switcher to "Activated".
Please pay attention that secret key will be show only one time, so make sure you save it in any secure key store
While you are generating new web hook keys you should make sure your web-hook server is online. To check it the test request will be performed. The request will be performed with HEAD method. As a result your web hook service should respond with 200 http status code
All web hook requests are performing using POST method and with application/json content type. Consumer server should respond with 200 HTTP status code. If consumer was unable to handle web-hook, the request will be retry every 10 minutes but not more than 5 times.
All web-hook requests are performing with
{
"method": "string",
"params": {
"nonce": 0
},
"id": "uniqueID"
}method - string. The name of method which was evaluated. Web hooks API supports such web-hook methods:
- code.apply. Performs when code owned by a customer was applied.
id - string. Uuid to identify every request.
params - the request payload. Here you can find useful data about passed actions, which triggered web hook call. Also in this field placed a nonce. 'nonce' - a number that is always greater than the previous request’s nonce number
Also, all request contains additional data in headers:
'Content-type': 'application/json''X-TXC-APIKEY': api_key- where api_key is your public WhiteBit API key'X-TXC-PAYLOAD': payload'- where payload is base64-encoded body data'X-TXC-SIGNATURE': signature- where signature ishex(HMAC_SHA512(payload), key=api_secret))
On consumer side you can process security headers to be sure request was performed by WhiteBIT.
Performed when code was applied. Request example:
{
"method": "code.apply",
"params": {
"code": "<SOME_WHITE_BIT_CODE>",
"nonce": 1
},
"id": "45a1d85d-2fdf-483e-8dfa-6d253148c730"
}