Enable Duplicate Check Option

Purpose

To enable the Duplicate Check Preference in the Leads module. 

You can enable the Duplicate Check Preference option in the UI by following steps:

  1. Go to Setup.
  2. Select Customization.
  3. Choose Modules and Fields.
  4. Click on the Leads module.
  5. Right-click the Leads module and enable the Duplicate Check Preference option.

There are two types you can configure the Duplicate Check Preference
  i. Converted Leads (converted_records)  
  ii. Contacts (mapped_module_records)

 

Request Details

Request URL

{api-domain}/crm/{version}/settings/duplicate_check_preference

Header

Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52

Scope

scope = ZohoCRM.settings.ALL  (or)
scope = ZohoCRM.settings.duplicate_check_preference.{operation_type} 

Possible operation types

ALL - Full data access 
CREATE - Enable duplicate record check preference 

Supported module

Leads 

Parameter

  • modulestring, mandatory

    Represents the module API name where you want to enable the duplicate check preference. Supported module: Leads. 

    To avoid duplicate entries, check for duplicates in the Leads module using unique field values. In the Contacts module, map the unique fields from the Leads module with the unique fields in the Contacts module to cross-check for duplicate records in the org. 

     

Sample Request

Copiedcurl "https://www.zohoapis.com/crm/v7/settings/duplicate_check_preference?module=Leads"
-X POST
-d "@input.json"
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxd"

Input JSON Keys for the "type" : "converted_records" (Converted Leads)


 The system will always check for duplicates on all the Leads using the unique fields. By selecting this option, the duplicates will be checked on all the Converted Leads as well. This configuration is applicable across all the layouts.

modules_API_changes
  • duplicate_check_preferenceJSON object, mandatory

    Represents the duplicate record check preference details in the Leads module.

    • typestring, mandatory

      Represents the type of duplicate record check preference. Here, it is "converted_records" i.e., Converted Leads.

Sample Input to enable Duplicate check preference for the "type":"Converted Record"

Copied{
    "duplicate_check_preference": {
        "type": "converted_records",
    }
}

Sample Response

Copied{
    "duplicate_check_preference": {
        "code": "SUCCESS",
        "details": {},
        "message": "Duplicate check enabled for converted_records successfully.",
        "status": "success"
    }
}

Input JSON Keys for the "type" : "mapped_module_records" (Contacts)


 

By selecting this option, the system will check for duplicates  in the Contacts module using mapped fields.

modules_API_changes
  • duplicate_check_preferenceJSON object

    Represents the details of the duplicate record check preference in the "Contacts" module.

  • typestring, mandatory

    Represents the type of duplicate record check preference. Here, it is "mapped_module_records"  i.e., Contacts.

  • type_configurationsJSON array, mandatory

    Represents the configuration type.

    • field_mappingJSON array, mandatory

      Represents the unique fields mapping in Leads and Contacts modules.

      • current_fieldJSON object, mandatory

        Represents the unique fields in the Leads module that are mapped to the unique fields in the Contacts module.

        • api_namestring, mandatory(either ID or or API name of the unique field is mandatory to map unique fields)

          Represents the API name of the unique field in the Leads module. Use the GET Fields Metadata  to retrieve the API names of the unique fields.

        • idstring, mandatory(either ID or or API name of the unique field is mandatory to map unique fields)

          Represents the ID of the unique field in the Leads module. Use the GET Fields Metadata  to retrieve IDs of the unique fields.

      • mapped_fieldJSON object, mandatory

        Represents the unique fields in the Contacts module to which the unique fields in the Leads module are mapped to.

        • api_namestring, mandatory(either ID or or API name of the unique field is mandatory to map unique fields)

          Represents the API name of the unique field in the Contacts module. Use the GET Fields Metadata  to retrieve the API names of the unique fields.

        • idstring, mandatory(either ID or or API name of the unique field is mandatory to map unique fields)

          Represents the ID of the unique field in the Contacts module. Use the GET Fields Metadata  to retrieve IDs of the unique fields.

    • mapped_moduleJSON object, mandatory

      Represents the details of the mapped module i.e., the module to which the unique fields in the Leads module are mapped to. In this case, Contacts module. 

      • api_namestring, mandatory (either ID or or API name of the unique field is mandatory to map unique fields)

        Represents the API name of the mapped module. Use the GET Module Metadata to retrieve the API name of the mapped module. (API name of the Contacts module)

      • idstring, mandatory (either ID or or API name of the unique field is mandatory to map unique fields)

        Represents the ID of the mapped module. Use the GET Module Metadata to retrieve the ID of the mapped module (ID of the Contacts module).

Sample Input to enable Duplicate check preference for the "type" : "Mapped Module Records"

Copied{
    "duplicate_check_preference": {
        "type": "mapped_module_records",
        "type_configurations": [
            {
                "field_mappings": [
                    {
                        "current_field": {
                            "api_name": "Email",
                            "id": "2276164000000000563"
                        },
                        "mapped_field": {
                            "api_name": "Email",
                            "id": "2276164000000000449"
                        }
                    }
                ],
                "mapped_module": {
                    "api_name": "Contacts",
                    "id": "2423488000000000129"
                }
            }
        ]
    }
}

Possible Errors

  • INVALID_DATAHTTP 400
    • The module API names given in the input seem to be invalid
      Resolution : Specify a valid module API name. Use the GET Module Metadata API to retrieve module API names.
    • The given field IDs or API names seem to be invalid
      Resolution : Specify valid unique IDs or API names of the unique fields, using the GET - Fields Metadata API.
    • The given field IDs or API names seem to be invalid
      Resolution : Specify the correct IDs or API names of the unique and other fields. Retrieve those details using the GET Module Metadata API and GET Fields Metadata API
    • Invalid data
      Resolutions :
      • Specify valid values for the mapped_field, mapped_module, and current_field keys. Refer to the Sample Input section above.
      • Specify valid data types for the mapped_field, mapped_module, and current_field keys, and their respective fields. Refer to the Sample Input section above.
  • NOT_SUPPORTEDHTTP 400

    This API does not support the specified module 
    Resolution: Specify the supported module. Supported Module : Leads

  • ALREADY_CONFIGUREDHTTP 400

    Already configured
    Resolution: The duplicate check preference you are trying to enable is already configured.

  • FEATURE_NOT_SUPPORTEDHTTP 400

    Feature not supported for the module specified in the "mapped_module" key 
    Resolution: Please specify a valid module. Supported Module : Contacts

  • NOT_ALLOWEDHTTP 400

    The specified API names or IDs of the unique fields for mapping are not valid unique field API names
    Resolutions:

    • Specify only the unique fields for mapping. 
    • Specify only the IDs or API names of unique fields, using the GET - Fields Metadata API.
  • AMBIGUITY_DURING_PROCESSINGHTTP 400
    • Ambiguity while processing the request
      Resolution: Verify input fields before sending the request. Refer to the Sample Input section above.
    • Two different CRM fields are found
      Resolution: The fields you are trying to map seem to be different. Map only the valid unique fields.
  • DEPENDENT_FIELD_MISSINGHTTP 400

    Dependent fields missing
    Resolutions:

    • Specify all mandatory fields. Refer to the Sample Input section above.
    • To configure the duplicate check option for Contacts or mapped_module_records, it is mandatory to use the "type_configurations" JSON array to map unique fields. Refer to the Sample Input section above.
  • MANDATORY_NOT_FOUND HTTP 400

    Mandatory fields are missing
    Resolution: Specify all mandatory fields. Refer to the Sample Input sections above.

  • 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. Specify a valid request method. Refer to the endpoints section above.

  • EXPECTED_FIELD_MISSINGHTTP 400

    One or more expected fields missing
    Resolution: Specify all required fields. Refer to the sample input section above.

  • REQUIRED_PARAM_MISSING HTTP 400

    Required parameter is missing
    Resolutions:

    Specify the module API name in which you are trying to enable duplicate check option. Supported module : Leads.

  • OAUTH_SCOPE_MISMATCHHTTP 401

    Unauthorized
    Resolution: The client does not have a valid scope to enable duplicate record check option. Create a new token with the required scopes. Refer to the scope section above.

  • AUTHENTICATION_FAILUREHTTP 401

    Authentication failed
    Resolution: Pass the access token in the request header of the API call.

  • NO_PERMISSIONHTTP 403

    No permission to access the module
    Resolution: Contact the administrator.

  • 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. Referto the request URL section above.

  • INTERNAL_ERRORHTTP 500

    Internal Server Error
    Resolution: Unexpected and unhandled exception in the server. Contact support team.

Sample Response

Copied{
    "duplicate_check_preference": {
        "code": "SUCCESS",
        "details": {},
        "message": "Duplicate check enabled for mapped_module_records successfully.",
        "status": "success"
    }
}