Chilkat Online Tools

DataFlex / Zoho CRM REST APIs / Sales Orders

Back to Collection Items

Use ChilkatAx-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>"

    Get ComQuickRequest Of hoHttp "DELETE" "https://domain.com/crm/v2.1/Sales_Orders?ids={{record_id1,record_id2,." 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 DELETE
	-H "Authorization: Bearer <access_token>"
https://domain.com/crm/v2.1/Sales_Orders?ids={{record_id1,record_id2,..}}

Postman Collection Item JSON

{
  "name": "Sales Orders",
  "request": {
    "auth": {
      "type": "bearer",
      "bearer": [
        {
          "key": "token",
          "value": "{{access-token}}",
          "type": "string"
        }
      ]
    },
    "method": "DELETE",
    "header": [
    ],
    "url": {
      "raw": "{{api-domain}}/crm/v2.1/Sales_Orders?ids={{record_id1,record_id2,..}}",
      "host": [
        "{{api-domain}}"
      ],
      "path": [
        "crm",
        "v2.1",
        "Sales_Orders"
      ],
      "query": [
        {
          "key": "ids",
          "value": "{{record_id1,record_id2,..}}"
        }
      ]
    },
    "description": "To delete entities or records from the Sales Orders module."
  },
  "response": [
  ]
}