$requestWrapper = new RequestWrapper();
$callbackVar = new CallBack();
$callbackVar->setUrl("
your_callback_url
");
$callbackVar->setMethod(new Choice("post"));
$requestWrapper->setCallback($callbackVar); |
Data Type
|
Example |
Number
|
$conditionVar = new Criteria(); $field = new MinifiedFields(); $field ->setAPIName("Amount"); $conditionVar>setField($field); $conditionVar->setComparator(new Choice("greater_than")); $conditionVar->setValue(10000); |
Multi-select
|
$conditionVar = new Criteria(); $field = new MinifiedFields(); $field ->setAPIName("owner"); $conditionVar>setField($field); $conditionVar->setComparator(new Choice("in")); $owner = ["5545974393001", "5545974393011"] $conditionVar->setValue($owner); |
DateTime
|
$conditionVar = new Criteria(); $field = new MinifiedFields(); $field->setAPIName("Created_Time"); $conditionVar>setField($field); $conditionVar->setComparator(new Choice("between")); $createdTime = [date_create("2023-05-01T17:58:47+05:30")->setTimezone(new \DateTimeZone(date_default_timezone_get())), date_create("2023-06-01T17:58:47+05:30")->setTimezone(new \DateTimeZone(date_default_timezone_get()))]; $conditionVar->setValue($createdTime); |
Boolean
|
$conditionVar = new Criteria(); $field = new MinifiedFields(); $field ->setAPIName("Email_Opt_Out"); $conditionVar>setField($field); $conditionVar->setComparator(new Choice("equal")); $conditionVar->setValue(false); |
Lookup
|
$conditionVar = new Criteria(); $field = new MinifiedFields(); $field ->setAPIName("owner.last_name"); $conditionVar>setField($field); $conditionVar->setComparator(new Choice("equal")); $conditionVar->setValue("Boyle"); |
$criteriaVar = new Criteria(); $criteriaVar->setGroupOperator(new Choice("operatorValue")); $conditionVar1 = new Criteria(); $fieldVar = new MinifiedFields(); $fieldVar->setAPIName("Field_API_Name"); $conditionVar1->setField($fieldVar); $conditionVar1->setComparator(new Choice("comparatorValue")); $conditionVar1->setValue("Field_Value"); $conditionVar2 = new Criteria(); $field = new MinifiedFields(); $field->setAPIName("Field_API_Name"); $conditionVar2->setField($fieldVar); $conditionVar2->setComparator(new Choice("comparatorValue")); $conditionVar2->setValue("Field_Value"); $criteriaVar->setGroup([$conditionVar1,$conditionVar2]); $query->setCriteria($criteriaVar); $requestWrapper->setQuery($query); |
{ "query": { "criteria": { "group_operator": "operatorValue", "group": [ { "comparator": "comparatorValue", "field": { "api_name": "Field_API_Name" }, "value": "Field_Value" }, { "comparator": "comparatorValue", "field": { "api_name": "Field_API_Name" }, "value": "Field_Value" } ] } } } |
//top-level group criteria with 2 different groups comprising of 2 different conditions each $criteria = new Criteria(); $criteria->setGroupOperator(new Choice("operatorValue")); //group1 with 2 different conditions $groupVar1 = new Criteria(); $groupVar1->setGroupOperator(new Choice("operatorValue")); $conditionVar11 = new Criteria(); $field11 = new MinifiedFields(); $field11->setAPIName("Field_API_Name"); $conditionVar11->setField($field11); $conditionVar11->setComparator(new Choice("comparatorValue")); $conditionVar11->setValue("Value"); $conditionVar12 = new Criteria(); $field12 = new MinifiedFields(); $field12->setAPIName("Field_API_Name"); $conditionVar12->setField($field21); $conditionVar12->setComparator(new Choice("comparatorValue")); $conditionVar12->setValue("Value"); $groupVar1->setGroup([$conditionVar11, $conditionVar12]); //group2 with 2 different conditions $groupVar2 = new Criteria(); $groupVar2->setGroupOperator(new Choice("operatorValue")); $conditionVar21 = new Criteria(); $field21 = new MinifiedFields(); $field21->setAPIName("Field_API_Name"); $conditionVar21->setField($field21); $conditionVar21->setComparator(new Choice("comparatorValue")); $conditionVar21->setValue("Value"); $conditionVar22 = new Criteria(); $field22 = new MinifiedFields(); $field22->setAPIName("Field_API_Name"); $conditionVar22->setField($field22); $conditionVar22->setComparator(new Choice("comparatorValue")); $conditionVar22->setValue("Value"); $groupVar2->setGroup([$conditionVar21, $conditionVar22]); //pushing the groups to the top-level group criteria $criteria->setGroup([$groupVar1, $groupVar2]); |
{ "query": { "criteria": { "group_operator": "operatorValue", "group": [ { "group_operator": "operatorValue", "group": [ { "comparator": "comparatorValue", "field": { "api_name": "Field_API_Name" }, "value": "Field_Value" }, { "comparator": "comparatorValue", "field": { "api_name": "Field_API_Name" }, "value": "Field_Value" } ] }, { "group_operator": "operatorValue", "group": [ { "comparator": "comparatorValue", "field": { "api_name": "Field_API_Name" }, "value": "Field_Value" }, { "comparator": "comparatorValue", "field": { "api_name": "Field_API_Name" }, "value": "Field_Value" } ] } ] } } } |
<?php use com\zoho\crm\api\bulkread\BulkReadOperations; use com\zoho\crm\api\bulkread\CallBack; use com\zoho\crm\api\util\Choice; use com\zoho\crm\api\bulkread\Query; use com\zoho\crm\api\bulkread\Criteria; use com\zoho\crm\api\bulkread\RequestWrapper; use com\zoho\crm\api\modules\MinifiedModule; use com\zoho\crm\api\fields\MinifiedFields; require_once "vendor/autoload.php"; class CreateBulkReadJob { public static function initialize() { // Add initialisation code // Refer to this article for more help } public static function createBulkReadJob(string $moduleAPIName) { $bulkReadOperations = new BulkReadOperations(); $requestWrapper = new RequestWrapper(); $callback = new CallBack(); $callback->setUrl("https://www.callback.com/example"); $callback->setMethod(new Choice("post")); $requestWrapper->setCallback($callback); //query $query = new Query(); $module = new MinifiedModule(); $module->setAPIName($moduleAPIName); $query->setModule($module); $query->setCvid("34770610087501"); $query->setFields(["Last_Name"]); $query->setPage(1); //top-level group criteria with 2 different groups comprising of 2 different conditions each $criteria = new Criteria(); $criteria->setGroupOperator(new Choice("or")); $criteriaList = array(); //group1 with 2 different conditions $groupVar1 = new Criteria(); $groupVar1->setGroupOperator(new Choice("and")); $conditionVar11 = new Criteria(); $field11= new MinifiedFields(); $field11->setAPIName("Last_Name"); $conditionVar11->setField($field11); $conditionVar11->setComparator(new Choice("equal")); $conditionVar11->setValue("Boyle"); $conditionVar12 = new Criteria(); $field12 = new MinifiedFields(); $field->setAPIName("Owner"); $conditionVar12->setField($field12); $conditionVar12->setComparator(new Choice("in")); $owner = array("5545974000000393001","5545974000000393011"); $conditionVar12->setValue($owner); $groupVar1->setGroup([$conditionVar11, $conditionVar12]); //group2 with 2 different conditions $groupVar2 = new Criteria(); $groupVar2->setGroupOperator(new Choice("or")); $conditionVar21 = new Criteria(); $field21 = new MinifiedFields(); $field21->setAPIName("Company"); $conditionVar21->setField($field21); $conditionVar21->setComparator(new Choice("equal")); $conditionVar21->setValue("Morlong Associates"); $conditionVar22 = new Criteria(); $field22= new MinifiedFields(); $field22->setAPIName("Created_Time"); $conditionVar22->setField($field22); $conditionVar22->setComparator(new Choice("between")); $createdTime = array(date_create("2023-04-15T17:58:47+05:30")->setTimezone(new \DateTimeZone(date_default_timezone_get())), date_create("2023-06-01T17:58:47+05:30")->setTimezone(new \DateTimeZone(date_default_timezone_get()))); $conditionVar22->setValue($createdTime); $groupVar2->setGroup([$conditionVar21, $conditionVar22]); //pushing the groups to the top-level group criteria $criteria->setGroup($criteriaList); $query->setCriteria($criteria); $requestWrapper->setQuery($query); // $requestWrapper->setFileType(new Choice("ics")); for Events module $response = $bulkReadOperations->createBulkReadJob($requestWrapper); //Add your code to handle the response received in $response // For more details, refer here. } } CreateBulkReadJob::initialize(); $moduleAPIName = "Leads"; CreateBulkReadJob::createBulkReadJob($moduleAPIName); ?> |
<?php use com\zoho\crm\api\bulkread\BulkReadOperations; require_once "vendor/autoload.php"; class GetBulkReadJobDetails { public static function initialize() { // Add initialisation code // Refer to this article for more help } public static function getBulkReadJobDetails(string $jobId) { $bulkReadOperations = new BulkReadOperations(); $response = $bulkReadOperations->getBulkReadJobDetails($jobId); //Add your code to handle the response received in $response // For more details, refer here. } } GetBulkReadJobDetails::initialize(); $jobId = "55459743108003"; GetBulkReadJobDetails::getBulkReadJobDetails($jobId); ?> |
<?php namespace samples\bulkread; use com\zoho\crm\api\bulkread\BulkReadOperations; require_once "vendor/autoload.php"; class DownloadResult { public static function initialize() { // Add initialisation code // Refer to this article for more help } public static function downloadResult(string $jobId, string $destinationFolder) { $bulkReadOperations = new BulkReadOperations(); $response = $bulkReadOperations->downloadResult($jobId); $streamWrapper = $response->getObject()->getFile(); fputs(fopen($destinationFolder . "/" . $streamWrapper->getName(), "w"), $streamWrapper->getStream()); //Add your code to handle the response received in $response // For more details, refer here. } } DownloadResult::initialize(); $jobId = "55459743108003"; $destinationFolder = "/Downloads"; DownloadResult::downloadResult($jobId, $destinationFolder); ?> |
Writer is a powerful online word processor, designed for collaborative work.