API Reference
DBot OfficialDBot DashboardPricing

Batch Replacement of Copy Wallets (WS)

Used to batch replace task wallets for multiple copy tasks

FreePlusProEnterpriseCredit 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": "batchUpdateFollowOrder", // Method to batch replacement of copy wallets
  "params": {
    "ids": [
      "m8zl720z0043pp",
      "m81lt5qn043csv",
      "m7cpk8n00043l1"
    ], // The ID of the copy trading tasks
    "walletId": "mglnkaeh0043pd" // The id of the wallet to be used, which can be obtained via the "Wallet Info API"
  }
}

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": "batchUpdateFollowOrder",
        "params": {
          "ids": [
            "m8zl720z0043pp",
            "m81lt5qn043csv",
            "m7cpk8n00043l1"
          ],
          "walletId": "mglnkaeh0043pd"
        }
      })
    )

    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": "batchUpdateFollowOrder",
        "params": {
            "ids": [
                "m8zl720z0043pp",
                "m81lt5qn043csv",
                "m7cpk8n00043l1"
            ],
            "walletId": "mglnkaeh0043pd"
        }
    }

    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())

Request Parameters visualization reference