/registerWebhook
1 min
POST
http://1.1.1.1/registerWebhook
webhook_urlstringThe webhook URL to be registered
typeinteger<p>the type of webhook:</p>
<ul>
<li>0 - input transaction - notifying the user about incoming transactions into our system.</li>
<li>1 - approve transaction - notifying the user about transactions that wait to his approval.</li>
<li>2 - output transaction - notifying the user about output transactions states.</li>
<li>3 - balance alert - notifying the user about balance changes related to given threshold.</li>
</ul>
filterobjecta Json containing the filters by which you want to filter the data for the webhook.
* - For input transaction webhook, the filter must contain the following fields: CoinSymbol, Machine, AccountId
* and MinAmount, for example:
* filter: {
* "CoinSymbol": "BTC",
* "Machine": "Hot",
* "AccountIds": ["1"],
* "MinAmount": "10000"
* }
* For output transaction webhook, the filter can contain optional fields: CoinSymbols, Machine , AccountIds, AlertEvent
* alert event types - "All confirmations"/"First confirmation"/"Confirmed"/"Sent"/"No funds available"/"Created"
/"Failed-Limits"/"Failed-Technical"/"Sent"/"No funds available"/"Timeout occurred"
/"Waiting to be processed" /"Cancelled"/"Waiting for external co-signer"
/"Cancelled group changed"/"Cancelled account changed"/"Replaced"/"Confirmed"
* For example:
* filter: {
* "CoinSymbols": ["BTC","XRP"],
* "Machine": "Hot",
* "AccountIds": ["1"],
* "AlertEvent": ["All confirmations"]
* }
*
* - For aleret balance webhook, the filter must contain the following fields: CoinSymbol, Threshold
*, the filter can contain optional fields: Machine , AccountIds, AlertEvent
* and MinAmount, for example:
* filter: {
* "CoinSymbol": "BTC",
* "Machine": "Hot",
* "AccountIds": ["1"],
* "Threshold": Amount in smallest units (satoshi, wei, drops, lovelace..),
* "AlertEvent: "Below"/ "Above"
* Approve transaction webhook does not require any filters, so you can choose not to send this parameter,
* or to send an empty Json
bodyobjectRequest data for setting up a webhook filter.
200success
curl --request POST \
--url 'http://1.1.1.1/registerWebhook?webhook_url=http%3A%2F%2F192.168.1.25%3A5000%2Fwebhook%2FBTC%2FMainAccount%2FHot&type=integer&filter=%22{%5Cn%20%20%5C%22AccountIds%5C%22%3A%20[%5C%221%5C%22]%2C%5Cn%20%20%5C%22CoinSymbol%5C%22%3A%20%5C%22BTC%5C%22%2C%5Cn%20%20%5C%22Machine%5C%22%3A%20%5C%22Hot%5C%22%2C%5Cn%20%20%5C%22MinAmount%5C%22%3A%20%5C%2210000%5C%22%5Cn}%5Cn%22' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"Filter": {
"CoinSymbol": "BTC",
"Machine": "Hot",
"MinAmount": "10000"
},
"WebhookUrl": "http://192.168.1.25:5000/webhook/BTC/MainAccount/Hot",
"Meta": {
"FunctionName": "registerWebhook",
"RandomData": "288cd49d4b8bf00e7d6114b78d5668d5581d6b953fafef779133caa844cd4229",
"Destination": "b9cb8afe52f1d52521cf2b62dfe12146156ad5328f83c62c20c7da81b263356a61340de745c858998544c041798b01c2f4fac31bebe52a19280a32cd57d6d374ea",
"Time": "2021-02-07T18:37:46.948Z",
"Source": "048b99461a70a49abe63fd585cb224177a22a92d2e9e4ddfbc0027887bee9d1843388f42a3eb2e740565e115ad8b7981abf59e3b03b771f4b063b53c517d7a9d99",
"AccessToken": "dc677a163ffcb090c243c2e7574db515c2fe8a44e2e979987a0eaefd2646d34b"
}
}'Registers a new webhook and returns a success/failed status
- return - registration status
example:
*registerWebhook("http://192.168.1.22:8027",0,{("BTC","1")})