API Reference
DBot OfficialDBot DashboardPricing

(Multi)Disable Copy Trading (WS)

Used to batch disable specified copy trading 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": "batchToggleFollowOrder", // Method to batch disable/enable specified copy trading tasks
  "params": {
    "ids": [
      "m8zl720z0043pp",
      "m81lt5qn043csv",
      "m7cpk8n00043l1"
    ], // Copy trading task id list
    "enabled": true, // "true" means enabling copy trading
    "closePnlOrder": "false" // Whether to disable all take profit / stop loss tasks created by copy trading at the same time, the default is "false", which means not disabled (valid when "enabled" is false)
  }
}

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": "batchToggleFollowOrder",
        "params": {
          "ids": [
            "m8zl720z0043pp",
            "m81lt5qn043csv",
            "m7cpk8n00043l1"
          ],
          "enabled": true,
          "closePnlOrder": "false"
        }
      })
    )

    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": "batchToggleFollowOrder",
        "params": {
            "ids": [
                "m8zl720z0043pp",
                "m81lt5qn043csv",
                "m7cpk8n00043l1"
            ],
            "enabled": true,
            "closePnlOrder": "false"
        }
    }

    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