Chilkat Online Tools

Powershell / Coupa Postman Collection - OAuth - Master / Approve an Approval

Back to Collection Items

Add-Type -Path "C:\chilkat\ChilkatDotNet47-9.5.0-x64\ChilkatDotNet47.dll"

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

$http = New-Object Chilkat.Http

# Adds the "Authorization: Bearer <access_token>" header.
$http.AuthToken = "<access_token>"

$resp = $http.QuickRequest("PUT","https://domain.com/approvals/:id/approve?&fields=[`"id`",`"status`",`"approval-date`",`"approver-type`",`"approver-id`",`"approvable-type`",`"approvable-id`"]")
if ($http.LastMethodSuccess -eq $false) {
    $($http.LastErrorText)
    exit
}

$($resp.StatusCode)
$($resp.BodyStr)

Curl Command

curl -X PUT
	-H "Authorization: Bearer <access_token>"
https://domain.com/approvals/:id/approve?&fields=["id","status","approval-date","approver-type","approver-id","approvable-type","approvable-id"]

Postman Collection Item JSON

{
  "name": "Approve an Approval",
  "request": {
    "method": "PUT",
    "header": [
    ],
    "url": {
      "raw": "{{URL}}/approvals/:id/approve?&fields=[\"id\",\"status\",\"approval-date\",\"approver-type\",\"approver-id\",\"approvable-type\",\"approvable-id\"]",
      "host": [
        "{{URL}}"
      ],
      "path": [
        "approvals",
        ":id",
        "approve"
      ],
      "query": [
        {
          "key": null,
          "value": null
        },
        {
          "key": "fields",
          "value": "[\"id\",\"status\",\"approval-date\",\"approver-type\",\"approver-id\",\"approvable-type\",\"approvable-id\"]"
        }
      ],
      "variable": [
        {
          "key": "id",
          "value": "4"
        }
      ]
    }
  },
  "response": [
  ]
}