How To Delete Record in Zoho CRM Modules

Here We Learn How to delete Record in zoho modules using api in Curl Request.

How to Delete Data In Zoho Module

Before making the api call to Insert records with the rest apis we need to follow some Steps.

1: To generate the Auth Token, you need to follow Below URL.   

https://www.thecodehubs.com/generate-access-code-using-postman-for-zoho

2: Create zoho-delete.php file to delete record in module and put below code in this file.

Request URL :

https://www.zohoapis.com/crm/v2/{Module_name}?ids={EntityID}

Where,
       Module_name: The API name of the module
       EntityID : The unique ID of the record
      Possible_Module_name: leads, accounts, contacts, deals, campaigns, tasks, cases, events, calls, solutions, products, vendors, pricebooks, quotes, salesorders, purchaseorders, invoices, custom, and notes.

<?php 
 
$header = array(
    'Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf" 
);

$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, "https://www.zohoapis.com/crm/v2/Leads?ids=420305000003465040,420405000006262021");
curl_setopt( $curl, CURLOPT_HTTPHEADER, $header );
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, "DELETE" );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
$response = curl_exec($ch);
curl_close($ch);
?>

How to Delete Specific Record Data In Zoho Module

If We need to delete specific Record from module follow below code,

<?php
$header = array(
    'Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf" 
);

$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, "https://www.zohoapis.com/crm/v2/Leads/410684010002628013");
curl_setopt( $curl, CURLOPT_HTTPHEADER, $header );
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, "DELETE" );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
$response = curl_exec($ch);
curl_close($ch);
?>

 

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe

Select Categories