Chilkat Online Tools

Swift / Binance spot API / Query Isolated Margin Account Info (USER_DATA)

Back to Collection Items

func chilkatTest() {
    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    let http = CkoHttp()
    var success: Bool

    let queryParams = CkoJsonObject()
    queryParams.UpdateString("timestamp", value: "{{timestamp}}")
    queryParams.UpdateString("signature", value: "{{signature}}")

    http.SetRequestHeader("Content-Type", value: "application/json")
    http.SetRequestHeader("X-MBX-APIKEY", value: "{{binance-api-key}}")

    var resp: CkoHttpResponse? = http.QuickRequestParams("GET", url: "https://domain.com/sapi/v1/margin/isolated/account", json: queryParams)
    if http.LastMethodSuccess == false {
        print("\(http.LastErrorText)")
        return
    }

    print("\(resp!.StatusCode.intValue)")
    print("\(resp!.BodyStr)")
    resp = nil

}

Curl Command

curl -G -d "timestamp=%7B%7Btimestamp%7D%7D"
	-d "signature=%7B%7Bsignature%7D%7D"
	-H "Content-Type: application/json"
	-H "X-MBX-APIKEY: {{binance-api-key}}"
https://domain.com/sapi/v1/margin/isolated/account

Postman Collection Item JSON

{
  "name": "Query Isolated Margin Account Info (USER_DATA)",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Content-Type",
        "type": "text",
        "value": "application/json"
      },
      {
        "key": "X-MBX-APIKEY",
        "value": "{{binance-api-key}}",
        "type": "text"
      }
    ],
    "url": {
      "raw": "{{url}}/sapi/v1/margin/isolated/account?timestamp={{timestamp}}&signature={{signature}}",
      "host": [
        "{{url}}"
      ],
      "path": [
        "sapi",
        "v1",
        "margin",
        "isolated",
        "account"
      ],
      "query": [
        {
          "key": "symbols",
          "value": "BTCUSDT,BNBUSDT,ADAUSDT",
          "description": "Max 5 symbols can be sent; separated by ','",
          "disabled": true
        },
        {
          "key": "recvWindow",
          "value": "5000",
          "description": "The value cannot be greater than 60000",
          "disabled": true
        },
        {
          "key": "timestamp",
          "value": "{{timestamp}}",
          "description": "UTC timestamp in ms"
        },
        {
          "key": "signature",
          "value": "{{signature}}",
          "description": "Signature"
        }
      ]
    },
    "description": "- If \"symbols\" is not sent, all isolated assets will be returned.\n- If \"symbols\" is sent, only the isolated assets of the sent symbols will be returned.\n\nWeight(IP): 10"
  },
  "response": [
  ]
}