### Configure and Initialize Zoho CRM PHP SDK v4 and v5 Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Learn to configure and initialize Zoho CRM PHP SDK v4 and v5 for seamless integration. This setup is crucial for using the SDK's functionalities. ```php setAPIDomain("https://www.zohoapis.com"); $initialize->setAccountsURL("https://accounts.zoho.com"); $initialize->setClient_id("2xxxxxxxxx"); $initialize->setClient_secret("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); $initialize->setRedirect_uri("http://localhost:8888/callback.php"); $initialize->setScope("ZohoCRM.users.ALL"); $initialize->setAPIVersion("v5"); $initialize->setGenType("UserSignature"); $initialize->setPersistenceEnable(true); $initialize->setGrant_type("authorization_code"); $initialize->setChannel("User"); $initialize->setRefreshToken("1000.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); $initialize->setAccessToken("1000.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); $initialize->setExpiry("2020-06-20T10:00:00+05:30"); $initialize->setTokenType("User"); $initialize->setRedirectURL("http://localhost:8888/callback.php"); $initialize->setIDToken("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); $initialize->setModule("Contacts"); $initialize->setAPIPath("/crm/v5/"); $initialize->setSDKContext($user); $initialize->initialize(); ZohoLogger::info("SDK initialized successfully"); } } } ?> ``` -------------------------------- ### Automate Record Restoration with Recycle Bin APIs in Deluge Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Learn to restore deleted records programmatically using Zoho CRM's Recycle Bin APIs with a Deluge example. This is useful for integration use cases. ```deluge //Deluge Script for restoring records from Recycle Bin delete zoho.crm.recyclebin.restore("Contacts", "10000000000001"); ``` -------------------------------- ### CRM Variables Usage in Deluge Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Demonstrates the usage of a CRM variable within a Deluge function. This example shows how to access and utilize CRM variables programmatically. ```deluge void getOrgVariable(string orgVarName) { //Get the org variable by its name orgDetail = zoho.crm.getOrgVariable(orgVarName); info orgDetail; //Access the value of the org variable variableValue = orgDetail.get("org_variable_1"); info variableValue; } ``` -------------------------------- ### Notification APIs Source: https://www.zoho.com/crm/developer/docs/api/v8 Get notified whenever a data change occurs inside your CRM. ```APIDOC ## Notification APIs ### Description Get notified whenever a data change occurs inside your CRM. ### Method POST ### Endpoint /crm/v8/webhooks ### Parameters #### Request Body - **url** (string) - Required - The URL to send the notification to. - **events** (array) - Required - An array of events to subscribe to (e.g., 'AllModuleDataCreation', 'AllModuleDataUpdate'). ### Request Example POST /crm/v8/webhooks { "url": "https://example.com/webhook", "events": [ "AllModuleDataCreation", "AllModuleDataUpdate" ] } ### Response #### Success Response (200) - **id** (string) - The ID of the webhook subscription. - **message** (string) - Success message. #### Response Example { "id": "webhook123", "message": "Webhook created successfully." } ``` -------------------------------- ### Configure and Initialize Zoho CRM Scala SDK (V6) Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Learn how to configure and initialize the Zoho CRM Scala SDK (V6) for making authenticated API calls using a self-client. ```scala import com.zoho.api.authenticator.OAuthToken import com.zoho.crm.scaladks.Initializer val clientId = "YOUR_CLIENT_ID" val clientSecret = "YOUR_CLIENT_SECRET" val refreshToken = "YOUR_REFRESH_TOKEN" val token = OAuthToken(clientId, clientSecret, refreshToken) Initialiser.initialize(token) ``` -------------------------------- ### Associate Circuit with Button and Blueprint Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Learn how to associate a Circuit with a button and a blueprint, and understand the output of each functional state within a circuit. ```yaml circuits: - name: "MyCircuit" description: "Orchestrates functions for a specific process." states: - name: "StartState" type: "start" next_state: "ProcessState" - name: "ProcessState" type: "function" function: "my_function_name" next_state: "EndState" - name: "EndState" type: "end" transitions: - from: "StartState" to: "ProcessState" - from: "ProcessState" to: "EndState" ``` -------------------------------- ### Customize Wizards with Client Script Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Learn how to customize wizards using Client Script. This enables dynamic behavior and tailored user experiences within wizard interfaces. ```javascript function customizeWizard(executionContext) { var wizard = ZDK.Wizard.getWizard("wizard_api_name"); wizard.setStep("step_api_name"); wizard.setField("field_api_name", "value"); } ``` -------------------------------- ### Portal APIs - Part I: Manage Portals and Users Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Learn about managing portals in Zoho CRM, including fetching, creating, and updating portals. Also covers fetching portal user types, inviting users, and retrieving users by type. ```php setZohoSDKContext(null); $commonAPIHandler->setAPIPath("/crm/v5/settings/portals"); $commonAPIHandler->setHttpMethod("GET"); $commonAPIHandler->addHeader("Accept", "application/json"); $commonAPIHandler->addHeader("Content-Type", "application/json"); $commonAPIHandler->setRecordJSON($requestSchema); $response = $commonAPIHandler->getAPIResponse("com.zoho.crm.api.settings.portals.PortalsOperations", "get_portals"); if ($response instanceof APIResponse) { print_r($response->getObject()->getDetails()); print_r($response->getObject()->getStatus()); } else if ($response instanceof CommonAPIHandler) { print_or_log($response->getErrorMessage()); print_or_log($response->getErrorCode()); print_or_log($response->getError()); print_or_log($response->getErrorIndex()); } } public static function print_or_log($value) { if (is_string($value) || is_int($value)) { ZohoLogger::info(strval($value)); } else { print_r($value); } } } } ?> ``` -------------------------------- ### Test Circuit and Associate with Workflow Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Discusses an exciting use case for Circuits in Zoho CRM, how to test a circuit, and associate it with a workflow. ```yaml circuits: - name: "DataValidationCircuit" description: "Validates data before record creation." states: - name: "ValidateEmail" type: "function" function: "validate_email_function" next_state: "ValidationComplete" - name: "ValidationComplete" type: "end" workflows: - name: "On Lead Create" trigger: "on_create" module: "Leads" actions: - type: "execute_circuit" circuit_name: "DataValidationCircuit" ``` -------------------------------- ### Create Dashboard Widget for Blog Feed Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Learn how to create a dashboard widget that displays the most recent blog posts of your preferred products or services. ```javascript ZOHO.ready(function(){ ZOHO.CRM.WIDGET.add( { "display_label": "Blog Feed", "url": "/portal/home/custom//index.html", "type": "html", "name": "Blog Feed", "ரிக்க": "1" } ); }); ``` -------------------------------- ### Using ZDK CRM APIs in Client Script Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Demonstrates how to use ZDK CRM APIs within Client Script. This enables interaction with CRM data and functionalities directly from client-side scripts. ```javascript function getRecordUsingZDK(executionContext) { var recordId = executionContext.getArguments().get("recordId"); var module = executionContext.getArguments().get("module"); ZDK.CRM.API.Record.get(module, recordId).then(function(data){ console.log(data); }); } ``` -------------------------------- ### Use Client Script for Non-Mandatory Blueprint Pop-ups Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Learn how to leverage Client Script to manage non-mandatory pop-up behavior within Zoho CRM Blueprints. ```javascript ZOHO.CRM.FIELD.getLayout("Leads").then(function(layout){ // Process layout to identify fields and their properties console.log(layout); }); ZOHO.CRM.UI.Popup.open({ "title": "Optional Action", "height": "300px", "width": "500px", "display_type": "modal", "url": "/portal/home/custom//index.html" }); ``` -------------------------------- ### Navigate and Pass Data with Zoho CRM Client Script Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Learn how to navigate to another page using Client Script and pass data from one script to another. ```javascript ZOHO.CRM.NAVIGATION.to("page", "") .then(function(data){ // Handle navigation success }); ZOHO.CRM.PAGE.getArgs().then(function(args){ // Access passed data console.log(args); }); ``` -------------------------------- ### Query API using PHP SDK v5 Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Learn how to query data using the Zoho CRM PHP SDK (v5). Supports various operators for different data types. ```php setZohoSDKContext(null); $commonAPIHandler->setAPIPath("/crm/v5/coql"); $commonAPIHandler->setHttpMethod("POST"); $commonAPIHandler->addHeader("Accept", "application/json"); $commonAPIHandler->addHeader("Content-Type", "application/json"); $commonAPIHandler->setRecordJSON($requestSchema); $response = $commonAPIHandler->getAPIResponse("com.zoho.crm.api.query.QueryOperations", "query"); if ($response instanceof APIResponse) { if (count($response->getObject()->getData()) > 0) { foreach ($response->getObject()->getData() as $key=>$value) { print_r($value); } } else { $handler = new CommonAPIHandler(); $handler->setZohoSDKContext(null); $handler->setAPIPath("/crm/v5/coql"); $handler->setHttpMethod("POST"); $handler->addHeader("Accept", "application/json"); $handler->addHeader("Content-Type", "application/json"); $handler->setRecordJSON($requestSchema); $response = $handler->getAPIResponse("com.zoho.crm.api.query.QueryOperations", "query"); if ($response instanceof APIResponse) { if ($response->getObject()->getMoreInfo() != null) { print_r("More info : " . $response->getObject()->getMoreInfo()); print_r("Next action to be taken : " . $response->getObject()->getNextActionToTake()); print_r("Next call token : " . $response->getObject()->getNextCallToken()); } } else { $handler = $response; print_r($handler->getErrorMessage()); print_r($handler->getErrorCode()); print_r($handler->getError()); print_r($handler->getErrorIndex()); } } } else if ($response instanceof CommonAPIHandler) { print_or_log($response->getErrorMessage()); print_or_log($response->getErrorCode()); print_or_log($response->getError()); print_or_log($response->getErrorIndex()); } } public static function print_or_log($value) { if (is_string($value) || is_int($value)) { ZohoLogger::info(strval($value)); } else { print_r($value); } } } } ?> ``` -------------------------------- ### Zoho CRM Widgets with ReactJS Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Explore how to use ReactJS and other client-side frameworks for building Zoho CRM widgets. ```javascript import React from 'react'; import ReactDOM from 'react-dom'; function MyWidget() { return (

Hello from React Widget!

); } ReactDOM.render(, document.getElementById('root')); ``` -------------------------------- ### Orchestrate Functions with Zoho CRM Circuits Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Learn the power of Circuits in Zoho CRM to orchestrate Functions and automate complex business processes. ```yaml circuits: - name: "OrderProcessingCircuit" description: "Handles the order processing workflow." states: - name: "CreateOrder" type: "function" function: "create_order_function" next_state: "SendNotification" - name: "SendNotification" type: "function" function: "send_order_confirmation_email" next_state: "Complete" - name: "Complete" type: "end" transitions: - from: "CreateOrder" to: "SendNotification" - from: "SendNotification" to: "Complete" ``` -------------------------------- ### Lead Conversion using Zoho CRM APIs Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Learn in detail about lead conversion and how to perform this operation using Zoho CRM APIs. ```json { "lead_conversion_details": { "overwrite": true, "assign_to": 4402000000000001, "deal_name": "New Deal" } } ``` -------------------------------- ### Handle Timeouts in Zoho CRM Client Script Functions Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Learn how to invoke Functions in Client Script and manage timeouts effectively. ```javascript ZOHO.APICall.invokeFunction("your_function_name", {"param1": "value1"}) .then(function(data){ // Handle function response }, function(error){ // Handle function error or timeout console.error(error); }); ``` -------------------------------- ### Bulk Write Parent-Child Records with Scala SDK Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Detailed explanation on importing bulk write for parent-child records in a single API call using the Scala SDK. Covers CSV file creation and input JSON preparation. ```scala import com.zoho.crm.scaladks.api.ScalaCrm import com.zoho.crm.scaladks.model.Record import com.zoho.crm.scaladks.model.fields.FieldValue // Assuming records and relatedRecords are prepared ScalaCrm.Record objects val parentRecord = Record().addKeyValue("Last Name", "Test Parent") val childRecord1 = Record().addKeyValue("Subform Field 1", "Child Value 1") val childRecord2 = Record().addKeyValue("Subform Field 1", "Child Value 2") val subformValues = List(childRecord1, childRecord2) val bulkWriteAction = ScalaCrm.getBulkWriteActions val requestWrapper = bulkWriteAction.newRequestWrapper() val parentRecords = List(parentRecord.addKeyValue("Subform API Name", subformValues)) requestWrapper.setParent(parentRecords) val response = bulkWriteAction.upload(requestWrapper, "module_api_name") println(response.getStatus) println(response.getData) ``` -------------------------------- ### Bulk Read APIs in PHP SDK v4 Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Utilize bulk read APIs in the PHP SDK (v4). Provides insights into structuring criteria for various field data types. ```php setZohoSDKContext(null); $commonAPIHandler->setAPIPath("/crm/v4/bulk/read"); $commonAPIHandler->setHttpMethod("POST"); $commonAPIHandler->addHeader("Accept", "application/json"); $commonAPIHandler->addHeader("Content-Type", "application/json"); $commonAPIHandler->setRecordJSON($requestSchema); $response = $commonAPIHandler->getAPIResponse("com.zoho.crm.api.bulkread.BulkReadOperations", "read"); if ($response instanceof APIResponse) { print_r($response->getObject()->getDetails()); print_r($response->getObject()->getStatus()); } else if ($response instanceof CommonAPIHandler) { print_or_log($response->getErrorMessage()); print_or_log($response->getErrorCode()); print_or_log($response->getError()); print_or_log($response->getErrorIndex()); } } public static function print_or_log($value) { if (is_string($value) || is_int($value)) { ZohoLogger::info(strval($value)); } else { print_r($value); } } } } ?> ``` -------------------------------- ### Bulk APIs Source: https://www.zoho.com/crm/developer/docs/api/v8 Push and retrieve data from Zoho CRM in bulk using a set of asynchronous APIs. ```APIDOC ## Bulk APIs ### Description Push and retrieve data from Zoho CRM in bulk using a set of asynchronous APIs. ### Method POST, GET ### Endpoint /crm/v8/bulk/{module_api_name} ### Parameters #### Path Parameters - **module_api_name** (string) - Required - The API name of the module. #### Query Parameters - **job_id** (string) - Required - The ID of the bulk job. #### Request Body - **data** (array) - Required - An array of records to be processed in bulk. ### Request Example POST /crm/v8/bulk/Leads { "data": [ { "Last_Name": "Brown", "Company": "Tech Solutions" }, { "Last_Name": "Davis", "Company": "Innovate Ltd" } ] } ### Response #### Success Response (200) - **job_id** (string) - The ID of the initiated bulk job. - **status** (string) - The status of the bulk job. #### Response Example { "status": "Success", "job_id": "12345abcde" } ``` -------------------------------- ### File Manager in CRM Widget using ZRC Methods Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Integrate WorkDrive with Zoho CRM Widgets using ZRC methods for file management capabilities within the CRM interface. ```javascript //Example of ZRC API for file operations ZOHO.CRM.API.File.upload({ Entity: "Contacts", RecordID: "10000000000001", File: "/path/to/your/file.txt" }).then(function(data){ //Handle file upload response }); ``` -------------------------------- ### Metadata APIs Source: https://www.zoho.com/crm/developer/docs/api/v8 Fetch the metadata of modules, fields, layouts, custom views, and related lists. ```APIDOC ## Metadata APIs ### Description Fetch the metadata of modules, fields, layouts, custom views, and related lists. ### Method GET ### Endpoint /crm/v8/settings/modules ### Parameters #### Query Parameters - **fields** (string) - Optional - Specify the fields to retrieve for each module. ### Response #### Success Response (200) - **modules** (array) - List of module metadata. - **fields** (array) - List of field metadata. - **layouts** (array) - List of layout metadata. - **custom_views** (array) - List of custom view metadata. - **related_lists** (array) - List of related list metadata. #### Response Example { "message": "Success", "code": 200 } ``` -------------------------------- ### ZDKs for Canvas Pages using Client Script Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Understand how to use ZDKs for canvas pages within Client Script. This allows for customization and interaction on canvas-based pages. ```javascript function getCanvasPageData(executionContext) { var recordId = executionContext.getArguments().get("recordId"); var module = executionContext.getArguments().get("module"); ZDK.Canvas.getCanvasPage("canvas_page_api_name", recordId).then(function(data){ console.log(data); }); } ``` -------------------------------- ### Link/Unlink Deal APIs in Zoho CRM Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Learn how to use Link Deal APIs and Associate Email API in Zoho CRM for managing deal associations. This post compares these two methods. ```javascript //Example of Link Deal API usage ZOHO.CRM.API.linkRecord("Deals", "10000000000001", "Contacts", "10000000000002").then(function(data){ //Handle response }); ``` -------------------------------- ### Color Coding List and Detail Pages using Client Script Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Applies color codes to List and Detail Pages of Zoho CRM using Client Script. This involves manipulating the UI elements to achieve the desired color scheme. ```javascript function colorCodingListAndDetailPages(executionContext) { var recordId = executionContext.getArguments().get("recordId"); var module = executionContext.getArguments().get("module"); var page = executionContext.getArguments().get("page"); if (page == "list") { var list = ZDK.Page.getList(); list.forEach(function(row){ row.getCell("Last Activity Time").getStyle().setBackgroundColor("#FF0000"); }); } else if (page == "detail") { var detail = ZDK.Page.getDetail(); detail.getCell("Lead Source").getStyle().setBackgroundColor("#00FF00"); } } ``` -------------------------------- ### Generate AI-Powered Follow-up Emails with CRM Functions and Widgets Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Build a Zoho CRM widget to generate AI-powered follow-up emails using CRM Functions. Emails can be sent directly from a record using ZRC APIs. ```javascript //Example of ZRC API usage in a widget ZOHO.CRM.API.getRecord({Entity: "Contacts",RecordID: "10000000000001"}).then(function(data){ //Process record data }); ``` -------------------------------- ### Smart Discount-Based Quote Approvals with CRM Functions Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Design quote approvals based on discounts using Zoho CRM Functions, Workflow Rules, and the Approval Process. This ensures accurate routing and governance. ```deluge //Deluge Script for discount-based approval logic if (input.Discount > 10) { //Trigger approval process } ``` -------------------------------- ### Query APIs Source: https://www.zoho.com/crm/developer/docs/api/v8 Fetch records using the SELECT query (SQL syntax) from Zoho CRM. ```APIDOC ## Query APIs ### Description Fetch records using the SELECT query (SQL syntax) from Zoho CRM. ### Method POST ### Endpoint /crm/v8/coql ### Parameters #### Request Body - **SELECT** (string) - Required - The fields to select. - **FROM** (string) - Required - The module to query from. - **WHERE** (string) - Optional - The condition for filtering records. - **LIMIT** (integer) - Optional - The maximum number of records to return. - **OFFSET** (integer) - Optional - The number of records to skip. ### Request Example POST /crm/v8/coql { "select_query": "SELECT Last_Name, Company FROM Leads WHERE Company = 'ABC Corp' LIMIT 10" } ### Response #### Success Response (200) - **data** (array) - An array of records matching the query. #### Response Example { "data": [ { "Last_Name": "Smith", "Company": "ABC Corp" } ] } ``` -------------------------------- ### Assign Values to Fields using Zoho CRM Python SDK Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Learn how to assign values to different field types in Zoho CRM using the Python SDK. This is part of a multi-part series on field management. ```python from zohocrmsdk.src.com.zoho.api.authenticator import OAuthToken from zohocrmsdk.src.com.zoho.crm import Initializer from zohocrmsdk.src.com.zoho.crm.api.record import RecordOperations, Record, FieldValue, Choice from zohocrmsdk.src.com.zoho.crm.api.fields import FieldsOperations # Initialize SDK client_id = "YOUR_CLIENT_ID" client_secret = "YOUR_CLIENT_SECRET" refresh_token = "YOUR_REFRESH_TOKEN" authenticator = OAuthToken(client_id, client_secret, refresh_token) Initializer.initialize(authenticator=authenticator) # Get field details fields_operations = FieldsOperations() response = fields_operations.get_fields("Leads") fields_data = response.get_data() # Create a record record_operations = RecordOperations() request_body = Record() # Assign values to fields # Example: Assigning a string to a text field request_body.add_field_value(FieldValue(field_id=1234567890123, value="Test Lead Name")) # Example: Assigning a picklist value choice = Choice() choice.set_value("Option 1") request_body.add_field_value(FieldValue(field_id=9876543210987, value=choice)) # Example: Assigning a lookup value lookup = Record() lookup.set_id(4402000000000001) request_body.add_field_value(FieldValue(field_id=3456789012345, value=lookup)) # Example: Assigning a subform subform_record = Record() subform_record.add_field_value(FieldValue(field_id=1122334455667, value="Subform Value 1")) request_body.add_field_value(FieldValue(field_id=5566778899001, value=[subform_record])) # Create the record response = record_operations.create_records("Leads", request_body) print(response.get_status_code()) print(response.get_data()) ``` -------------------------------- ### Manipulate Rich Text Field (RTF) using Zoho CRM APIs Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Learn how to create, add, and update values to Rich Text Fields (RTF) and understand their behavior in COQL and Bulk APIs. ```json { "fields": [ { "api_name": "description", "value": "This is bold text and this is italic." } ] } ``` -------------------------------- ### Portal APIs - Part II: Manage User Types and Access Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Manage user types and access within Zoho CRM portals. Covers creating, updating, deleting user types, transferring users, changing status, and deleting users. ```php setZohoSDKContext(null); $commonAPIHandler->setAPIPath("/crm/v5/settings/portal_user_types"); $commonAPIHandler->setHttpMethod("POST"); $commonAPIHandler->addHeader("Accept", "application/json"); $commonAPIHandler->addHeader("Content-Type", "application/json"); $commonAPIHandler->setRecordJSON($requestSchema); $response = $commonAPIHandler->getAPIResponse("com.zoho.crm.api.settings.portalusertype.PortalUserTypeOperations", "create_portal_user_type"); if ($response instanceof APIResponse) { print_r($response->getObject()->getDetails()); print_r($response->getObject()->getStatus()); } else if ($response instanceof CommonAPIHandler) { print_or_log($response->getErrorMessage()); print_or_log($response->getErrorCode()); print_or_log($response->getError()); print_or_log($response->getErrorIndex()); } } public static function print_or_log($value) { if (is_string($value) || is_int($value)) { ZohoLogger::info(strval($value)); } else { print_r($value); } } } } ?> ``` -------------------------------- ### Fetch Consolidated Data with Zoho CRM GraphQL API Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Use GraphQL APIs to fetch data across different modules in a single API call for a unified view in third-party applications. ```graphql query { contacts { id last_name email } accounts { id account_name website } } ``` -------------------------------- ### Composite API Source: https://www.zoho.com/crm/developer/docs/api/v8 Combine up to five API calls in a single request through this API. ```APIDOC ## Composite API ### Description Combine up to five API calls in a single request through this API. ### Method POST ### Endpoint /crm/v8/coql ### Parameters #### Request Body - **requests** (array) - Required - An array of API requests to be executed. - **method** (string) - Required - The HTTP method for the sub-request (e.g., GET, POST). - **url** (string) - Required - The URL for the sub-request. - **body** (object) - Optional - The request body for the sub-request. ### Request Example POST /crm/v8/coql { "requests": [ { "method": "GET", "url": "/crm/v8/settings/modules" }, { "method": "POST", "url": "/crm/v8/Leads", "body": { "data": [ { "Last_Name": "Doe", "Company": "XYZ Inc" } ] } } ] } ### Response #### Success Response (200) - **responses** (array) - An array of responses corresponding to each request in the composite call. #### Response Example { "responses": [ { "status": 200, "message": "Success", "result": { "modules": [...] } }, { "status": 200, "message": "Success", "result": { "data": [ { "code": 200, "message": "Success", "status": "success", "id": 1234567890124 } ] } } ] } ``` -------------------------------- ### User's Unavailability APIs Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Explore Zoho CRM's User's Unavailability APIs for managing user availability. Includes marking, updating, deleting unavailability periods, and retrieving availability details. ```php setZohoSDKContext(null); $commonAPIHandler->setAPIPath("/crm/v5/users/{user_id}/unavailable"); $commonAPIHandler->setHttpMethod("POST"); $commonAPIHandler->addHeader("Accept", "application/json"); $commonAPIHandler->addHeader("Content-Type", "application/json"); $commonAPIHandler->setRecordJSON($requestSchema); $response = $commonAPIHandler->getAPIResponse("com.zoho.crm.api.users.UserUnavailabilityOperations", "create_user_unavailability"); if ($response instanceof APIResponse) { print_r($response->getObject()->getDetails()); print_r($response->getObject()->getStatus()); } else if ($response instanceof CommonAPIHandler) { print_or_log($response->getErrorMessage()); print_or_log($response->getErrorCode()); print_or_log($response->getError()); print_or_log($response->getErrorIndex()); } } public static function print_or_log($value) { if (is_string($value) || is_int($value)) { ZohoLogger::info(strval($value)); } else { print_r($value); } } } } ?> ``` -------------------------------- ### Populate Field from Third-Party API using Client Script Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Learn how to populate a field's value based on the response received from a third-party API call within Zoho CRM Client Script. ```javascript fetch('https://api.example.com/data') .then(response => response.json()) .then(data => { ZOHO.CRM.FIELD.update({ "details": { "fields": { "": data.value } } }) .then(function(result){ console.log('Field updated successfully'); }); }) .catch(error => { console.error('Error fetching data:', error); }); ``` -------------------------------- ### Client Script for Notes Related List Validation Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Manage, validate, and protect notes based on custom criteria using Client Script for the Notes Related List in Zoho CRM. ```javascript //Client Script example for Notes validation form.Notes.onValidate = function(field, value) { if (value.length < 10) { return false; } return true; }; ``` -------------------------------- ### Use Postman for Zoho CRM API Calls Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Utilize boilerplate requests in the Zoho CRM Developer Workspace in Postman to make API calls effortlessly. ```postman GET https://www.zohoapis.com/crm/v6/settings/users Authorization: Zoho-oauthtoken YOUR_OAUTH_TOKEN ``` -------------------------------- ### Handle Multi-User Lookup Fields in API V4 Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Learn how to handle multi-user lookup fields in Zoho CRM API v4. This is essential for managing relationships between records involving multiple users. ```php setZohoSDKContext(null); $commonAPIHandler->setAPIPath("/crm/v4/settings/multi_user_lookup"); $commonAPIHandler->setHttpMethod("POST"); $commonAPIHandler->addHeader("Accept", "application/json"); $commonAPIHandler->addHeader("Content-Type", "application/json"); $commonAPIHandler->setRecordJSON($requestSchema); $response = $commonAPIHandler->getAPIResponse("com.zoho.crm.api.settings.multiuserlookup.MultiUserLookupOperations", "create_multi_user_lookup"); if ($response instanceof APIResponse) { print_r($response->getObject()->getDetails()); print_r($response->getObject()->getStatus()); } else if ($response instanceof CommonAPIHandler) { print_or_log($response->getErrorMessage()); print_or_log($response->getErrorCode()); print_or_log($response->getError()); print_or_log($response->getErrorIndex()); } } public static function print_or_log($value) { if (is_string($value) || is_int($value)) { ZohoLogger::info(strval($value)); } else { print_r($value); } } } } ?> ``` -------------------------------- ### Trigger Workflows with Zoho CRM Records API Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Utilize the 'trigger' key in Zoho CRM's Records APIs to initiate workflows, blueprints, and approvals. ```json { "trigger": { "workflow": true, "blueprint": true } } ``` -------------------------------- ### Core APIs Source: https://www.zoho.com/crm/developer/docs/api/v8 Perform CRUD operations on CRM module entities and integrate with any third-party application through flexible RESTful endpoints. ```APIDOC ## Core APIs ### Description Perform CRUD operations (Create, Read, Update, Delete) on CRM module entities and integrate with any third-party application through flexible RESTful endpoints. ### Method GET, POST, PUT, DELETE ### Endpoint /crm/v8/{module_api_name} ### Parameters #### Path Parameters - **module_api_name** (string) - Required - The API name of the module (e.g., Leads, Contacts). - **record_id** (long) - Required - The ID of the record to operate on. #### Query Parameters - **fields** (string) - Optional - Specify the fields to retrieve. - **duplicate_check_fields** (string) - Optional - Fields to check for duplicates during creation. #### Request Body - **data** (array) - Required - An array of record objects to create or update. - **field_api_name** (string) - Required/Optional - The API name of the field and its value. ### Request Example POST /crm/v8/Leads { "data": [ { "Last_Name": "Smith", "Company": "ABC Corp" } ] } ### Response #### Success Response (200) - **id** (long) - The ID of the created or updated record. - **message** (string) - Success message. #### Response Example { "data": [ { "code": 200, "message": "Success", "status": "success", "id": 1234567890123 } ] } ``` -------------------------------- ### Disable Clone Record based on Custom Condition Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Provides a solution to disable the 'Clone Record' functionality based on a custom condition. This helps in controlling data duplication. ```javascript function disableCloneRecord(executionContext) { var recordId = executionContext.getArguments().get("recordId"); var module = executionContext.getArguments().get("module"); var record = ZDK.CRM.API.Record.get(module, recordId); if (record.get("Status") == "Closed") { ZDK.Client.disableCloneRecord(true); } else { ZDK.Client.disableCloneRecord(false); } } ``` -------------------------------- ### Embed Zoho Desk Tickets in Zoho CRM using Related List Widget Source: https://www.zoho.com/crm/developer/docs/kaizen-series-directory.html?source_from=qlink_ Display Zoho Desk tickets within Zoho CRM Contact records using a Related List widget. This provides real-time support visibility. ```javascript //Example of ZRC API usage in a widget for embedding tickets ZOHO.CRM.API.RelatedList.get({Entity: "Contacts",RecordID: "10000000000001",RelatedList: "Tickets"}).then(function(data){ //Process ticket data }); ```