Chilkat Online Tools

PureBasic / Coupa Postman Collection - OAuth - Master / GET SIM Form Response in a particular status

Back to Collection Items

IncludeFile "CkJsonObject.pb"
IncludeFile "CkHttp.pb"
IncludeFile "CkHttpResponse.pb"

Procedure ChilkatExample()

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

    http.i = CkHttp::ckCreate()
    If http.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    success.i

    queryParams.i = CkJsonObject::ckCreate()
    If queryParams.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    CkJsonObject::ckUpdateString(queryParams,"status","pending_approval")

    ; Adds the "Authorization: Bearer <access_token>" header.
    CkHttp::setCkAuthToken(http, "<access_token>")

    resp.i = CkHttp::ckQuickRequestParams(http,"GET","https://domain.com/api/supplier_information/all/easy_form_responses",queryParams)
    If CkHttp::ckLastMethodSuccess(http) = 0
        Debug CkHttp::ckLastErrorText(http)
        CkHttp::ckDispose(http)
        CkJsonObject::ckDispose(queryParams)
        ProcedureReturn
    EndIf

    Debug Str(CkHttpResponse::ckStatusCode(resp))
    Debug CkHttpResponse::ckBodyStr(resp)
    CkHttpResponse::ckDispose(resp)



    CkHttp::ckDispose(http)
    CkJsonObject::ckDispose(queryParams)


    ProcedureReturn
EndProcedure

Curl Command

curl -G -d "status=pending_approval"
	-H "Authorization: Bearer <access_token>"
https://domain.com/api/supplier_information/all/easy_form_responses

Postman Collection Item JSON

{
  "name": "GET SIM Form Response in a particular status",
  "request": {
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{URL}}/api/supplier_information/all/easy_form_responses?status=pending_approval",
      "host": [
        "{{URL}}"
      ],
      "path": [
        "api",
        "supplier_information",
        "all",
        "easy_form_responses"
      ],
      "query": [
        {
          "key": "status",
          "value": "pending_approval"
        }
      ]
    }
  },
  "response": [
  ]
}