Support to subscribe the transaction-related data from all addresses in the project dimension, when subscribition is enabled, data and status will be pushed.
The subscription interface needs to make some technical preparations and pay attention to the following instruction:
Idempotent The webhook callback API needs to support idempotency.
Retry times If we do not receive a successful HTTP 200 response, we will attempt to retry the webhook, with the delay between each retry increasing. After the initial attempt, we will make up to 7 additional attempts.
The retry intervals are as follows: 1, 5, 10, 30, 60, 120, 240 minutes
Pause push The following situations will pause the sending of notifications
POST https://www.okx.com/api/v5/waas/subscribe
Parameter | Type | Required | Description |
---|---|---|---|
url | String | Yes | Url for webhook callback |
type | String | Yes | Currently supports TRANSACTION-Any transaction related to any address will trigger BLOCK_HEIGHT-Any block generated will trigger |
chainId | String | no | Unique identifier of the chain |
Parameter | Type | Description |
---|---|---|
curl --location --request POST 'https://www.okx.com/api/v5/waas/subscribe' \
--header 'OK-ACCESS-PROJECT: 86af********d1bc' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z' \
--data '{
"callbackUrl":"http://your.server.com/webhook",
"type":"TRANSACTION"
}'
{
"code": "0",
"msg": "success",
"data": []
}