Used to delete copy trading tasks
| Free | Plus | Pro | Enterprise | Credit Usage |
|---|---|---|---|---|
| ✅ | ✅ | ✅ | ✅ | 0 |
URL
wss://api-bot-v1.dbotx.com/trade/ws/
Notes
To ensure the availability and stability of the WebSocket connection, a heartbeat subscription must be sent at least once every minute (recommended every 30–55 seconds), otherwise the system will automatically disconnect the timeout link
Request Example
{
"id": 1761291309, // Call ID, the response returns the same ID as the request
"method": "deleteFollowOrders", // Method to Delete Copy Trading Tasks
"params": {
"id": ["mdcz91xo0009jx", "m9m7fngy000gzp"] // The IDs of copy trading tasks to be deleted
}
}Response Data
{
"method": "rpcResponse", // RPC response
"id": 1761291309, // Call ID
"result": {
"err": false // Request result status; false means succeeded, true means failed
}
}Example in NodeJS
const WebSocket = require('ws')
function main() {
const ws = new WebSocket('wss://api-data-v1.dbotx.com/trade/ws/', {
headers: {
'x-api-key': 'YOUR_API_KEY',
},
})
ws.on('open', () => {
ws.send(
JSON.stringify({
id: 1761291309,
method: 'deleteFollowOrders',
params: {
ids: ['mdcz91xo0009jx', 'm9m7fngy000gzp']
}
})
)
setInterval(() => {
ws.ping()
}, 30000)
})
ws.on('message', res => {
console.log('res:', res.toString('utf-8'))
})
}
main()Example in Python
import asyncio
import websockets
import json
async def main():
uri = "wss://api-data-v1.dbotx.com/trade/ws/"
headers = {"x-api-key": "YOUR_API_KEY"}
msg = {
"id": 1761291309,
"method": "deleteFollowOrders",
"params": {
"ids": ["mdcz91xo0009jx", "m9m7fngy000gzp"]
}
}
async with websockets.connect(uri, additional_headers=headers) as ws:
await ws.send(json.dumps(msg))
async def keep_alive():
while True:
await ws.ping()
await asyncio.sleep(30)
async def listen_for_messages():
async for message in ws:
print(message)
await asyncio.gather(keep_alive(), listen_for_messages())
if __name__ == "__main__":
asyncio.run(main())