Chilkat Online Tools

ERROR!

------------------- GenerateCode ----------------------
ImpliedContentType: 
explicitContentType: application/json
---- begin chilkat script ----
// This example assumes the Chilkat API to have been previously unlocked.
// See {{-global_unlock:::Global Unlock Sample-}} for sample code.

new Http http;
ckbool success;

new JsonObject queryParams;
ignore = queryParams.UpdateString("subAccountId","");
ignore = queryParams.UpdateString("timestamp","{{timestamp}}");
ignore = queryParams.UpdateString("signature","{{signature}}");

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


HttpResponse resp = http.QuickRequestParams("GET","https://domain.com/sapi/v1/broker/subAccount/bnbBurn/status",queryParams);
if (http.LastMethodSuccess == ckfalse) {
    println http.LastErrorText;
    return;
}

println resp.StatusCode;
println resp.BodyStr;
delete resp;

---- end chilkat script ----

PowerBuilder / Binance Broker API / Get BNB Burn Status for Sub Account

Back to Collection Items

integer li_rc
oleobject loo_Http
integer li_Success
oleobject loo_QueryParams
oleobject loo_Resp

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

loo_Http = create oleobject
// Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
    destroy loo_Http
    MessageBox("Error","Connecting to COM object failed")
    return
end if

loo_QueryParams = create oleobject
// Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
li_rc = loo_QueryParams.ConnectToNewObject("Chilkat.JsonObject")

loo_QueryParams.UpdateString("subAccountId","")
loo_QueryParams.UpdateString("timestamp","{{timestamp}}")
loo_QueryParams.UpdateString("signature","{{signature}}")

ERROR: Non-existent Chilkat method:  Http.SetRequestHeader
ERROR: Non-existent Chilkat method:  Http.SetRequestHeader

ERROR: Non-existent Chilkat method:  Http.SetRequestHeader
ERROR: Non-existent Chilkat method:  Http.SetRequestHeader

ERROR: Entry not found: Http.QuickRequestParams
ERROR: CodeGen:
  emitNewObject:
    atgType: Http
    varName: http
  --emitNewObject
  emitNewObject:
    atgType: JsonObject
    varName: queryParams
  --emitNewObject
  failedToLoadClass: Http
  failedToLoadClass: Http
  getApiProperty:
    Class not found
    className: Http
  --getApiProperty
--CodeGen

ERROR: Non-existent Chilkat method:  Http.QuickRequestParams
loo_Resp = loo_Http.QuickRequestParams("GET","https://domain.com/sapi/v1/broker/subAccount/bnbBurn/status",loo_QueryParams)
ERROR: Entry not found: Http.LastMethodSuccess
ERROR: CodeGen:
  emitNewObject:
    atgType: Http
    varName: http
  --emitNewObject
  emitNewObject:
    atgType: JsonObject
    varName: queryParams
  --emitNewObject
  failedToLoadClass: Http
  failedToLoadClass: Http
  getApiProperty:
    Class not found
    className: Http
  --getApiProperty
  failedToLoadClass: Http
  failedToLoadClass: Http
  getApiProperty:
    Class not found
    className: Http
  --getApiProperty
--CodeGen

if loo_Http.LastMethodSuccess = 0 then
ERROR: Entry not found: Http.LastErrorText
ERROR: CodeGen:
  emitNewObject:
    atgType: Http
    varName: http
  --emitNewObject
  emitNewObject:
    atgType: JsonObject
    varName: queryParams
  --emitNewObject
  failedToLoadClass: Http
  failedToLoadClass: Http
  getApiProperty:
    Class not found
    className: Http
  --getApiProperty
  failedToLoadClass: Http
  failedToLoadClass: Http
  getApiProperty:
    Class not found
    className: Http
  --getApiProperty
  failedToLoadClass: Http
  failedToLoadClass: Http
  getApiProperty:
    Class not found
    className: Http
  --getApiProperty
--CodeGen

    Write-Debug string(loo_Http.LastErrorText)
    destroy loo_Http
    destroy loo_QueryParams
    return
end if

Write-Debug string(loo_Resp.StatusCode)
Write-Debug loo_Resp.BodyStr
destroy loo_Resp


destroy loo_Http
destroy loo_QueryParams

Curl Command

curl -G -d "subAccountId="
	-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/broker/subAccount/bnbBurn/status

Postman Collection Item JSON

{
  "name": "Get BNB Burn Status for Sub Account",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Content-Type",
        "type": "text",
        "value": "application/json"
      },
      {
        "key": "X-MBX-APIKEY",
        "type": "text",
        "value": "{{binance-api-key}}"
      }
    ],
    "url": {
      "raw": "{{url}}/sapi/v1/broker/subAccount/bnbBurn/status?subAccountId=&timestamp={{timestamp}}&signature={{signature}}",
      "host": [
        "{{url}}"
      ],
      "path": [
        "sapi",
        "v1",
        "broker",
        "subAccount",
        "bnbBurn",
        "status"
      ],
      "query": [
        {
          "key": "subAccountId",
          "value": ""
        },
        {
          "key": "recvWindow",
          "value": "5000",
          "description": "The value cannot be greater than 60000",
          "disabled": true
        },
        {
          "key": "timestamp",
          "value": "{{timestamp}}"
        },
        {
          "key": "signature",
          "value": "{{signature}}"
        }
      ]
    }
  },
  "response": [
  ]
}