Chilkat Online Tools

lianja / Coupa Postman Collection - OAuth - Master / Retrieve User by login

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("login","CoupaSam1")

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

loResp = loHttp.QuickRequestParams("GET","https://domain.com/users/",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 "login=CoupaSam1"
	-H "Authorization: Bearer <access_token>"
https://domain.com/users/

Postman Collection Item JSON

{
  "name": "Retrieve User by login",
  "request": {
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{URL}}/users/?login=CoupaSam1",
      "host": [
        "{{URL}}"
      ],
      "path": [
        "users",
        ""
      ],
      "query": [
        {
          "key": "login",
          "value": "CoupaSam1"
        }
      ]
    }
  },
  "response": [
  ]
}