Hello everyone!
Welcome back to another week of Kaizen!
In this post, we will shed some light on the parameters in Search Records API and other generic parameters available in Zoho CRM APIs.
1. criteria
Use this parameter to search for records in a particular module based on criteria.
Syntax:
(({api_name}:{starts_with|equals}:{value})and/or({api_name}:{starts_with|equals}:{value})and/or...)
You can set a maximum of 10 conditions (starts_with & equals). When you use parentheses or commas in the value of criteria, you must escape them using a backslash. Further, you must encode the value.
Consider the search term:
((Last_Name:equals:Burns,B)and(First_Name:starts_with:M))
After escaping the comma and parenthesis in the value: ((Last_Name:equals:Burns\,B)and(First_Name:starts_with:M))
After encoding the value:
((Last_Name:equals:Burns%5C%2CB)and(First_Name:starts_with:M))
To use conditions other than starts_with or equals, refer to the Query API.
2. email
Use this parameter to search for records based on email IDs. All the fields with the field type "Email" in a particular module will be searched and listed. For instance, Primary Email, Secondary Email, and so on.
3. phone
Use this parameter to search for records based on phone numbers. All the fields with the field type "Phone" in a particular module will be searched and listed.
4. word
Use this parameter to perform a module-wise global search by word.
Note:
- You cannot search for records with two or more above mentioned parameters in one API call.
- If you specify two or more parameters simultaneously, preference will be given in the following order: criteria, email, phone, and word, and only one of them would work.
B. Other Generic Parameters
1. module
Use the module parameter to perform module-specific operations. For instance, to fetch module-specific metadata like fields, layouts, custom views, and so on. Specify the API name of the module as value. The module API names that can be passed differs from API to API. Refer to the corresponding API documentation to know the supported modules.
APIs in which the "module" parameter can be used:
Fields Metadata API, Layouts Metadata API, Specific Layout Metadata API, Related List Metadata API, Custom View Metadata API, Specific Custom View Metadata API, Get List of Deleted Records API, Get Tags API, Get Record Count For a Specific Tag API, Create Tags, Update a Specific Tag, Update Multiple Tags.
The API call in the example below retrieves the details of the fields in Leads module.
2. ids
Use the ids parameter to perform record specific operations. The "id" key in the Get Records API, represents the unique ID of the record.
APIs in which "ids" parameter can be used:
The API call in the example below deletes CRM variables based on ID.
We hope you found this post useful. Let us know your thoughts in the comment section or reach us out at support@zohocrm.com.
Cheers!