Chilkat Online Tools

DataFlex / Coupa Postman Collection - OAuth - Master / Soft close for invoicing line from external PO

Back to Collection Items

Use ChilkatAx-9.5.0-win32.pkg

Procedure Test
    Handle hoHttp
    Boolean iSuccess
    Variant vResp
    Handle hoResp
    String sTemp1
    Integer iTemp1
    Boolean bTemp1

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

    Get Create (RefClass(cComChilkatHttp)) To hoHttp
    If (Not(IsComObjectCreated(hoHttp))) Begin
        Send CreateComObject of hoHttp
    End

    // Adds the "Authorization: Bearer <access_token>" header.
    Set ComAuthToken Of hoHttp To "<access_token>"
    Send ComSetRequestHeader To hoHttp "Accept" "application/json"

    Get ComQuickRequest Of hoHttp "PUT" 'https://domain.com/purchase_order_lines/:id/soft_close_for_invoicing?fields=["id"]' To vResp
    If (IsComObject(vResp)) Begin
        Get Create (RefClass(cComChilkatHttpResponse)) To hoResp
        Set pvComObject Of hoResp To vResp
    End
    Get ComLastMethodSuccess Of hoHttp To bTemp1
    If (bTemp1 = False) Begin
        Get ComLastErrorText Of hoHttp To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    Get ComStatusCode Of hoResp To iTemp1
    Showln iTemp1
    Get ComBodyStr Of hoResp To sTemp1
    Showln sTemp1
    Send Destroy of hoResp


End_Procedure

Curl Command

curl -X PUT
	-H "Authorization: Bearer <access_token>"
	-H "Accept: application/json"
https://domain.com/purchase_order_lines/:id/soft_close_for_invoicing?fields=["id"]

Postman Collection Item JSON

{
  "name": "Soft close for invoicing line from external PO",
  "request": {
    "method": "PUT",
    "header": [
      {
        "key": "Accept",
        "value": "application/json",
        "type": "text"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": ""
    },
    "url": {
      "raw": "{{URL}}/purchase_order_lines/:id/soft_close_for_invoicing?fields=[\"id\"]",
      "host": [
        "{{URL}}"
      ],
      "path": [
        "purchase_order_lines",
        ":id",
        "soft_close_for_invoicing"
      ],
      "query": [
        {
          "key": "fields",
          "value": "[\"id\"]"
        }
      ],
      "variable": [
        {
          "key": "id",
          "value": "4569"
        }
      ]
    }
  },
  "response": [
  ]
}