Chilkat Online Tools

autoit / Binance delivery futures API / Renew Listen Key

Back to Collection Items

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

$oHttp = ObjCreate("Chilkat_9_5_0.Http")
Local $bSuccess

$oHttp.SetRequestHeader "Content-Type","application/json"
$oHttp.SetRequestHeader "X-MBX-APIKEY","{{binance-api-key}}"

Local $oResp = $oHttp.QuickRequest("PUT","https://domain.com/dapi/v1/listenKey")
If ($oHttp.LastMethodSuccess = False) Then
    ConsoleWrite($oHttp.LastErrorText & @CRLF)
    Exit
EndIf

ConsoleWrite($oResp.StatusCode & @CRLF)
ConsoleWrite($oResp.BodyStr & @CRLF)

Curl Command

curl -X PUT
	-H "Content-Type: application/json"
	-H "X-MBX-APIKEY: {{binance-api-key}}"
https://domain.com/dapi/v1/listenKey

Postman Collection Item JSON

{
  "name": "Renew Listen Key",
  "request": {
    "method": "PUT",
    "header": [
      {
        "key": "Content-Type",
        "type": "text",
        "value": "application/json"
      },
      {
        "key": "X-MBX-APIKEY",
        "type": "text",
        "value": "{{binance-api-key}}"
      }
    ],
    "url": {
      "raw": "{{url}}/dapi/v1/listenKey",
      "host": [
        "{{url}}"
      ],
      "path": [
        "dapi",
        "v1",
        "listenKey"
      ]
    }
  },
  "response": [
  ]
}