Chilkat Online Tools

Swift / Belvo API Docs / List

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

    http.BasicAuth = true
    http.Login = "{{secretId}}"
    http.Password = "{{secretPassword}}"

    let queryParams = CkoJsonObject()
    queryParams.UpdateInt("page", value: 1)

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

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

}

Curl Command

curl -G -d "page=1"
	-u '{{secretId}}:{{secretPassword}}'
https://domain.com/investments/portfolios/

Postman Collection Item JSON

{
  "name": "List",
  "request": {
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{baseUrl}}/investments/portfolios/?page=1",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "investments",
        "portfolios",
        ""
      ],
      "query": [
        {
          "key": "page",
          "value": "1"
        }
      ]
    }
  },
  "response": [
  ]
}