Chilkat Online Tools

DataFlex / Egyptian eInvoicing SDK R1.5 / 13. Decline Rejection Document

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 "Content-Type" "application/json"

    Get ComQuickRequest Of hoHttp "PUT" "https://domain.com/api/v1.0/documents/state/:documentUUID/decline/rejection" 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 "Content-Type: application/json"
https://domain.com/api/v1.0/documents/state/:documentUUID/decline/rejection

Postman Collection Item JSON

{
  "name": "13. Decline Rejection Document",
  "request": {
    "auth": {
      "type": "bearer",
      "bearer": [
        {
          "key": "token",
          "value": "{{generatedAccessToken}}",
          "type": "string"
        }
      ]
    },
    "method": "PUT",
    "header": [
      {
        "key": "Content-Type",
        "value": "application/json"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": ""
    },
    "url": {
      "raw": "{{apiBaseUrl}}/api/v1.0/documents/state/:documentUUID/decline/rejection",
      "host": [
        "{{apiBaseUrl}}"
      ],
      "path": [
        "api",
        "v1.0",
        "documents",
        "state",
        ":documentUUID",
        "decline",
        "rejection"
      ],
      "variable": [
        {
          "key": "documentUUID",
          "value": ""
        }
      ]
    }
  },
  "response": [
  ]
}