Chilkat Online Tools

Foxpro / Broker API / Trading Account

Back to Collection Items

LOCAL loHttp
LOCAL lnSuccess
LOCAL loSbResponseBody

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

loHttp = CreateObject('Chilkat_9_5_0.Http')

loHttp.BasicAuth = 1
loHttp.Login = "{{api_key}}"
loHttp.Password = "{{api_secret}}"

loSbResponseBody = CreateObject('Chilkat_9_5_0.StringBuilder')
lnSuccess = loHttp.QuickGetSb("https://domain.com/v1/trading/accounts/:account_id/account",loSbResponseBody)
IF (lnSuccess = 0) THEN
    ? loHttp.LastErrorText
    RELEASE loHttp
    RELEASE loSbResponseBody
    CANCEL
ENDIF

? "Response status code = " + STR(loHttp.LastStatus)
? loSbResponseBody.GetAsString()

RELEASE loHttp
RELEASE loSbResponseBody

Curl Command

curl -X GET
	-u '{{api_key}}:{{api_secret}}'
https://domain.com/v1/trading/accounts/:account_id/account

Postman Collection Item JSON

{
  "name": "Trading Account",
  "request": {
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{HOST}}/v1/trading/accounts/:account_id/account",
      "host": [
        "{{HOST}}"
      ],
      "path": [
        "v1",
        "trading",
        "accounts",
        ":account_id",
        "account"
      ],
      "query": [
        {
          "key": "",
          "value": null,
          "disabled": true
        }
      ],
      "variable": [
        {
          "key": "account_id",
          "value": ""
        }
      ]
    }
  },
  "response": [
  ]
}