Get Recycle Bin Record Count
Purpose
To get the total count of records in the Recycle Bin in your Zoho CRM account.
Endpoints
- GET /settings/recycle_bin/actions/count
- GET /settings/recycle_bin/actions/count?filters={filter_value}
Request Details
Request URL
{api-domain}/crm/{version}/settings/recycle_bin/actions/count
To fetch the number of records based on filters param:
{api-domain}/crm/{version}/settings/recycle_bin/actions/count?filters={filter_value}
Header
Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52
Scope
ZohoCRM.settings.recycle_bin.READ
Sample Request
Copiedcurl "https://www.zohoapis.com/crm/v8/settings/recycle_bin/actions/count"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"Parameters
- filtersJSON object, optional
To specify conditions to count only the records that meet the defined criteria.
Note : You must encode the filters parameter value before making the API call.
JSON keys in filters param:
- group_operator string, optional
Defines how to combine the multiple conditions defined in the group array.
Possible value : AND - groupJSON array, mandatory
An array of filter conditions, where each condition specifies the field, comparator and value.
- fieldJSON object
Represents the field by which the records should be filtered.
Possible values: display_name, module, deleted_by, deleted_time - comparatorstring
Represents the comparator operator to apply.
Possible values: equal, not_equal, contains, not_contains, starts_with, ends_with, greater_than, less_than - valuestring/JSON object
Represents the value to compare the field against. This can be a string or a JSON object, depending on the field. Refer to the sample section for more details.
Supported comparators for different fields
Field Supported Comparators display_name equal, not_equal, contains, not_contains, starts_with, ends_with module equal, not_equal deleted_by
equal, not_equal, contains, not_contains, starts_with, ends_with deleted_time equal, not_equal, greater_than, less_than
Sample filter parameter value
Copied{
"group_operator": "AND",
"group": [
{
"field": {
"api_name": "display_name"
},
"comparator": "contains",
"value": "Zane"
},
{
"field": {
"api_name": "module"
},
"comparator": "equal",
"value": "Contacts"
},
{
"field": {
"api_name": "deleted_by"
},
"comparator": "equal",
"value": [
{
"id": "111111000000050305",
"name": "Patricia Boyle"
}
]
},
{
"field": {
"api_name": "deleted_time"
},
"comparator": "greater_than",
"value": "2022-12-01T01:00:00+05:30"
}
]
}Possible Errors
- INVALID_REQUEST_METHODHTTP 400
The http request method type is not a valid one
Resolution: You have specified an invalid HTTP method to access the API URL. Retry this request with GET method. - OAUTH_SCOPE_MISMATCHHTTP 401
Unauthorized
Resolution: Client does not have the required OAUTH SCOPE. Create a new token with valid scope. Refer to the Scope section above for more details. - INVALID_DATAHTTP 403
The given group operator not supported. Only AND operator is supported
Resolution: Construct the filters parameter value with AND group operator.The given api_name seems to be invalid
Resolution: Specify valid api names for the fields in the filters parameter.
- INVALID_URL_PATTERNHTTP 404
Please check if the URL trying to access is a correct one
Resolution: The request URL specified is incorrect. Specify a valid request URL. Refer to the request URL section for more details. - INTERNAL_ERRORHTTP 500
Internal Server Error
Resolution: Unexpected and unhandled exception in Server. Contact support team.
Sample Request using filters parameter
Copiedcurl "https://www.zohoapis.com/crm/v8/settings/recycle_bin/actions/count?filters=%7B%22group_operator%22%3A%22AND%22%2C%22group%22%3A%5B%7B%22field%22%3A%7B%22api_name%22%3A%22module%22%7D%2C%22comparator%22%3A%22equal%22%2C%22value%22%3A%22Leads%22%7D%2C%7B%22field%22%3A%7B%22api_name%22%3A%22deleted_time%22%7D%2C%22comparator%22%3A%22greater_than%22%2C%22value%22%3A%222022-12-01T01%3A00%3A00%2B05%3A30%22%7D%5D%7D"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"Sample Response
Copied{
"count": 93
}