The Webhook function is mainly used to listen for a series of transaction changes and then callback them to the set Hook URL.
Configuration#
To configure your Webhook URL from the dashboard, make sure the Webhook URL is a POST
request.Support https and http requests.
When ALL IN ONE attempts to store the endpoint details, it ensures the endpoint is operational by sending a test webhook message, expecting a 200 response to confirm its active status.The client (System B receiving the webhook) must set up the webhook with specific configurations:1.
For the test message: The client should verify if the received message contains the word 'test.' If so, they should disregard it and simply respond with 'OK.' For any other scenarios, the message requires further processing.The message key for testing is designated as "This is a test message"
The message key for actual production use is set as "ok."
2.
Ensure that the system does not process messages repeatedly, In some cases, if the message is not confirmed to have been delivered, multiple messages are sent to confirm.
Test message#
Click the Test button on the page and a test message will be sent, the value of 'msg' in the test message is This is a test message
, msg
in a normal callback is always ok
and can be distinguished based on this.Security#
Every callback request contains a X-Auth-Key
header, this field is used for callback authentication. The receiver can verify the validity of the callback according to this field."X-Auth-Key": "Y46_M4ZWFP8JQQgFhmMvmzLmOqZ49rjY1SUUkQ6wDjQ"
The value of X-Auth-Key
can be obtained from the Auth Key
field in the dashboard to verify the validity of the callback, as follows:The IP address of the ALL IN ONE service is: 167.172.83.207
, you can add it to the IP whitelist to ensure normal communication.Webhook Name Explain#
Sub Address#
Notify when there is a transaction change in the sub-address
{
"success": true,
"msg": "ok",
"data": {
"chain": "BITCOIN",
"token": "BTC",
"hash": "09f48564be8272b922b316325a717ff64886cb007f2397e980e74525bdf4f555",
"addr": "0xfdF03d452906B57C7e68226e728809C8A3a02F6B",
"type": "receive",
"from_addr": "0x342bEeF2685576570e94c89937E9F2C1c97D78BC",
"to_addr": "0xfdF03d452906B57C7e68226e728809C8A3a02F6B",
"amount": "1",
"prices": [
{
"currency": "USDT",
"price": "1.0001",
"currency_amount": "67360.245000",
"price_timestamp": "2024-07-11 11:46:00"
},
{
"currency": "EUR",
"price": "1.11",
"currency_amount": "60684.684",
"price_timestamp": "2024-09-17 15:21:39"
}
],
"timestamp": 1720531841000
}
}
Withdraw#
Withdraw will notify when the status changes. Currently, AIO will return the following statusesCANCEL
: Cancelled transaction
ACTIVE
: Queue to wait for the transaction
AUTH
: User secondary authentication is required
FUNDS_LACK
: Insufficient funds (unable to activate or unable to trade)
FAILURE
: Transaction process unknown exception or on-chain confirmation failure
SUCCEED
: Transaction done
{
"success": true,
"msg": "This is a test message: ok",
"data": {
"id": "1",
"chain": "ETHEREUM",
"token": "USDT",
"amount": "2",
"prices": [
{
"currency": "USDT",
"price": "1.0001",
"currency_amount": "2.0002",
"price_timestamp": "2024-09-17 10:38:00"
},
{
"currency": "EUR",
"price": "1.11",
"currency_amount": "2.22",
"price_timestamp": "2024-09-17 15:21:39"
}
],
"created_at": "2024-09-17T10:38:00+00:00",
"modified_at": "2024-09-17T10:38:00+00:00",
"status": "SUCCEED"
}
}
Handle duplicate events#
Callback endpoints might occasionally receive the same event more than once. We advise you to guard against duplicated event receipts. One way of doing this is logging the events you’ve processed, and then not processing the logged ones.Retry logic#
All IN ONE server expects to get a 200
status code from you within 10 seconds. If the response code is different from 200
or a deadline is exceeded, we offer you a return visit of up to 14 hours and offer exponential backoff:num ^ 4 + num
seconds where num
is 1 to 15 retry1 | 0h 0m 2s
2 | 0h 0m 18s
3 | 0h 1m 24s
4 | 0h 4m 20s
5 | 0h 10m 30s
6 | 0h 21m 42s
7 | 0h 40m 8s
8 | 1h 8m 24s
9 | 1h 49m 30s
10 | 2h 46m 50s
11 | 4h 4m 12s
12 | 5h 45m 48s
13 | 7h 56m 14s
14 | 10h 40m 30s
15 | 14h 4m 0s
Modified at 2024-09-19 16:05:28