Chilkat Online Tools

lianja / Coupa Postman Collection - OAuth - Master / Get Supplier - using Status

Back to Collection Items

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

loHttp = createobject("CkHttp")

loQueryParams = createobject("CkJsonObject")
loQueryParams.UpdateString("status","active")
loQueryParams.UpdateString("fields",'["id","number","status"]')

// Adds the "Authorization: Bearer <access_token>" header.
loHttp.AuthToken = "<access_token>"

loResp = loHttp.QuickRequestParams("GET","https://domain.com/suppliers/",loQueryParams)
if (loHttp.LastMethodSuccess = .F.) then
    ? loHttp.LastErrorText
    release loHttp
    release loQueryParams
    return
endif

? str(loResp.StatusCode)
? loResp.BodyStr
release loResp


release loHttp
release loQueryParams

Curl Command

curl -G -d "status=active"
	-d "fields=%5B%22id%22,%22number%22,%22status%22%5D"
	-H "Authorization: Bearer <access_token>"
https://domain.com/suppliers/

Postman Collection Item JSON

{
  "name": "Get Supplier - using Status",
  "request": {
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{URL}}/suppliers/?status=active&fields=[\"id\",\"number\",\"status\"]",
      "host": [
        "{{URL}}"
      ],
      "path": [
        "suppliers",
        ""
      ],
      "query": [
        {
          "key": "status",
          "value": "active"
        },
        {
          "key": "fields",
          "value": "[\"id\",\"number\",\"status\"]"
        }
      ]
    }
  },
  "response": [
  ]
}