Skip to content

REST_Request_Response

Biboxcom edited this page Sep 18, 2018 · 2 revisions

API Request and Response Format

Bibox REST API parameter standard, supports a batch of requests, please read carefully.

Request Parameter

  • the request format of requiring apikey
// Request
{
    "cmds": [ // Supporting a batch of requests (different setting of cmd is used for differentiating the result of return)
        {
            "cmd": "orderpending/trade",
            "index": 1234567,
            "body": {
                "pair": "BIX_BTC",
                ... //other parameters
            }
        },
        {
            "cmd": "orderpending/cancelTrade",
            "body": {
                "orders_id": 12345
            }
        }
    ],
    "apikey": "**************", // your apikey
    "sign": "**************" // The result of signing cmds with you apisecret signature (serialized)
}
  • the request format of not requiring apikey
// Request
{
    "cmds": [
        {
            "cmd": "api/ticker",
            "body": {
                "pair": "BIX_BTC"
            }
        },
        
        {
            "cmd": "api/depth",
            "body": {
                "pair": "BIX_BTC",
                "size": 10,
            }
        }
    ]
}

The explanation of parameter

cmds: The encapsulation format of requesting parameter, arraytype, serialized is required when using, each element in array represents an independent API invoking.
cmd: The name of API interface, please refer to API Reference
body: The corresponding request parameter of cmd, please refer to API_Reference
apikey: The apikey alloacated by system
sign: The result of signing cmds (after formatting) with api secret allocated by system

The result of return

  • Request success return
{
    "result":[
        {
            "cmd":"api/pairList",
            "result":[
                {
                    "id":1,
                    "pair":"BIX_BTC"
                },
                {
                    "id":2,
                    "pair":"ETH_BTC"
                }
            ]
        }
    ]
}

The explanation of results

cmd: The name of API interface, please refer to API Reference
result(outside): a batch of requests of returning results, the order consistency is not guaranteed
result(inside): The result of returning specific cmd interface  
  • Request error return
{
    "error":{
        "code":"1000",
        "msg":"something error"
    }
}

The explanation of results

code: error code
msg: The description of error
  • a batch request of returns
{
    "result":[
        { //success
            "cmd":"api/pairList",
            "result":[
                {
                    "id":1,
                    "pair":"BIX_BTC"
                },
                {
                    "id":2,
                    "pair":"ETH_BTC"
                }
            ]
        },
        { //error
            "cmd":"api/depth",
            "error":{
                "code":"1000",
                "msg":"something error"
            }
        }
    ]
}

Example

// Request
{
    "cmds": [
        {
            "cmd": "orderpending/cancelTrade",
            "index": 12345,
            "body": {
                "orders_id": 1000032341
            }
        }
    ],
    "apikey": "**************",
    "sign": "**************"
}

// Response
{
    "result": [{
       "result":"cancelling",
       "index": 12345,
       "cmd":"orderpending/cancelTrade"
   }]
}

Bibox Exchange provides REST API and WebSocket API, which are convenient for investors to view the market and trade easily.

Bibox Exchange

https://www.bibox.com

REST API

WebSocket API

Contract

REST API

WebSocket API

Clone this wiki locally