/registerWebhook
1 min
POST
/registerWebhook
webhook_urlstringThe webhook URL to be registered
typeinteger<p>A Union value containing either an int type used in API version 15 or the new webhookType value(0: Input transaction, 1: Approve transaction, 2: Output transaction, 3: Balance alert). Only use one value.</p>
<p>The type of webhook:
0 - input transaction - notifying the user about incoming transactions into our system.
1 - approve transaction - notifying the user about transactions that wait for approval.
2 - output transaction - notifying the user about output transactions states.
3 - balance alert - notifying the user about balance changes related to given threshold.
4 - delay transaction - notifying the user about<br>
5 - collector - notifying the user about</p>
filterobject<p>A Json containing the filters by which you want to filter the data for the webhook.</p>
<ul>
<li>For the INPUT transaction webhook, the filter must contain ALL of the following fields: CoinSymbol, Machine, AccountId and MinAmount.
The Confirmations array lets the system know to notify you after the transaction reaches each set number of confirmations, and should contain up to 10 values.</li>
</ul>
<p>For example:
filter: {
"CoinSymbol": "BTC",
"Machine": "Hot",
"AccountIds": ["1"],
"MinAmount": "10000"
}</p>
<ul>
<li>
<p>For the OUTPUT transaction webhook, the filter MUST contain at least one of the following filters: AlertEvent, Confirmations.
The filter MAY contain any of the OPTIONAL fields: CoinSymbols, Machine , AccountIds, AlertEvent</p>
<p>There are many types of AlertEvents: No funds available, Created, Failed-Limits, Failed-Technical, Sent, Timeout occurred,
Waiting to be processed, Canceled, Waiting for external co-signer, Failed-Policy.
The Confirmations array lets the system know to notify you after the transaction reaches each set number of confirmations, and should contain up to 10 values.</p>
</li>
</ul>
<p>Example OUTPUT TRANSACTION filters:
AlertEvent filter: {
"CoinSymbols": ["BTC","XRP"],
"Machine": "Hot",
"AccountIds": ["1"],
"AlertEvent": ["Canceled"],
}
Confirmation filter: {
"CoinSymbols": ["BTC","XRP"],
"Machine": "Hot",
"AccountIds": ["1"],
"Confirmations":["1","15"]
}</p>
<ul>
<li>
<p>For the ALERT 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"</p>
</li>
<li>
<p>The APPROVE transaction webhook does not require any filters, so you can choose not to send this parameter,
or to send an empty Json</p>
</li>
</ul>
transaction_format_versionobject<p>Can be TransactionFormatVersion.V0 or TransactionFormatVersion.V2. V0 is the default and returns results using the legacy format. V2 returns results using a new, easier-to-parse structure.</p>
acceptstringGenerated from available response content types
bodyobjectRequest data for setting up a webhook filter.
200success
curl --request POST \
--url '/registerWebhook?webhook_url=http%3A%2F%2F192.168.1.25%3A5000%2Fwebhook%2FBTC%2FMainAccount%2FHot&type=integer&filter=%22None%22&transaction_format_version=2' \
--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"
}
}'