Skip to main content

Sample Codes

All of Zoho CRM's APIs can be used through the Java SDK, to enable your custom application to perform data sync to the best degree. Here are the sample codes for all the API methods available in our SDK.

Attachment Operations

ConstructorDescription
AttachmentsOperations(String moduleAPIName, String recordId)Creates an AttachmentsOperations class instance with the moduleAPIName and recordId.
MethodReturn TypeDescription
getAttachmentsAPIResponse<ResponseHandler>To fetch the list of attachments of a record.
uploadAttachmentsAPIResponse<ActionHandler>To upload attachments to a record.
deleteAttachmentsAPIResponse<ActionHandler>To delete the attachments that were added to a record.
deleteAttachmentAPIResponse<ActionHandler>To delete an attachment that was added to a record.
downloadAttachmentAPIResponse<ResponseHandler>To download an attachment that was uploaded to a record.
uploadLinkAttachmentsAPIResponse<ActionHandler>To upload a link as an attachment to a record.

Blueprint Operations

ConstructorDescription
BluePrintOperations(String recordId, String moduleAPIName)Creates a BluePrintOperations class instance with the recordId and moduleAPIName.
MethodReturn TypeDescription
getBlueprintAPIResponse<ResponseHandler>To get the next available transitions for that record, fields available for each transition, current value of each field, and validation(if any).
updateBlueprintAPIResponse<ActionResponse>To update a single transition at a time.

Bulk Read Operations

MethodReturn TypeDescription
createBulkReadJobAPIResponse<ActionHandler>To schedule a bulk read job to export records that match the criteria.
getBulkReadJobDetailsAPIResponse<ResponseHandler>To know the status of the bulk read job scheduled previously.
downloadResultAPIResponse<ResponseHandler>To download the result of the bulk read job. The response contains a zip file. Extract it to get the CSV or ICS file depending on the "file_type" you specified while creating the bulk read job

Bulk Write Operations

MethodReturn TypeDescription
uploadFileAPIResponse<ActionResponse>To upload a CSV file in ZIP format. The response contains the "file_id". Use this ID while making the bulk write request.
createBulkWriteJobAPIResponse<ActionResponse>To create a bulk write job to insert, update, or upsert records. The response contains the "job_id". Use this ID while getting the status of the scheduled bulk write job.
getBulkReadJobDetailsAPIResponse<ResponseWrapper>To know the status of the bulk read job scheduled previously.
downloadResultAPIResponse<ResponseHandler>To download the result of the bulk read job. The response contains a zip file. Extract it to get the CSV or ICS file depending on the "file_type" you specified while creating the bulk read job

Contact Roles Operations

MethodReturn TypeDescription
getContactRolesAPIResponse<ResponseHandler>To get the list of all contact roles.
createContactRolesAPIResponse<ActionHandler>To create contact roles.
updateContactRolesAPIResponse<ActionHandler>To update contact roles.
deleteContactRolesAPIResponse<ActionHandler>To delete contact roles.
getContactRoleAPIResponse<ResponseHandler>To get specific contact role.
updateContactRoleAPIResponse<ActionHandler>To update specific contact role.
deleteContactRoleAPIResponse<ActionHandler>To delete specific contact role.
getAllContactRolesOfADealAPIResponse<ActionHandler>This method is used to get all Contact Roles of deal and print the response.
getContactRolesOfDealAPIResponse<ResponseHandler>This method is used to get Contact Roles of deal and print the response.
addContactRolesToDealAPIResponse<ActionHandler>This method is used to add Contact Role to deal and print the response.
remContactRolesDealAPIResponse<ActionHandler>This method is used to remove Contact Roles from deal and print the response.

Currencies Operations

MethodReturn TypeDescription
getCurrenciesAPIResponse<ResponseHandler>To get the list of all currencies available for your org.
addCurrenciesAPIResponse<ActionHandler>To add new currencies to your org.
updateCurrenciesAPIResponse<ActionHandler>To update the currencies' details of your org.
enableMultipleCurrenciesAPIResponse<BaseCurrencyAction
Handler>
To enable multiple currencies for your org.
updateBaseCurrencyAPIResponse<BaseCurrencyAction
Handler>
To update the base currency details of your org.
getCurrencyAPIResponse<ResponseHandler>To get the details of specific currency.
updateCurrencyAPIResponse<ActionHandler>To update the details of specific currency.

Custom View Operations

ConstructorDescription
CustomViewsOperations(String module)Creates a CustomViewsOperations class instance with the moduleAPIName.
MethodReturn TypeDescription
getCustomViewsAPIResponse<ResponseHandler>To get the list of all custom views in a module.
getCustomViewAPIResponse<ResponseHandler>To get the details of specific custom view in a module.

Fields Metadata Operations

ConstructorDescription
FieldsOperations(String module)Creates a FieldsOperations class instance with the module.
MethodReturn TypeDescription
getFieldsAPIResponse<ResponseHandler>To get the meta details of all fields in a module.
getFieldAPIResponse<ResponseHandler>To get the meta details of specific field in a module.

Files Operations

MethodReturn TypeDescription
uploadFilesAPIResponse<ActionHandler>To upload files and get their encrypted IDs.
getFileAPIResponse<ResponseHandler>To get the uploaded file through its encrypted ID.

Layouts Operations

ConstructorDescription
LayoutsOperations(String module)Creates a LayoutsOperations class instance with the moduleAPIName.
MethodReturn TypeDescription
getLayoutsAPIResponse<ResponseHandler>To get the details of all the layouts in a module.
getLayoutAPIResponse<ResponseHandler>To get the details (metadata) of a specific layout in a module.

Modules Operations

MethodReturn TypeDescription
getModulesAPIResponse<ResponseHandler>To get the details of all the modules.
getModuleAPIResponse<ResponseHandler>To get the details (metadata) of a specific module.
updateModuleByAPINameAPIResponse<ActionHandler>To update the details of a module by its module API name.
updateModuleByIdAPIResponse<ActionHandler>To update the details of a module by its ID.

Notes Operations

MethodReturn TypeDescription
getNotesAPIResponse<ResponseHandler>To get the list of notes of a record.
createNotesAPIResponse<ActionHandler>To add new notes to a record.
updateNotesAPIResponse<ActionHandler>To update the details of the notes of a record.
deleteNotesAPIResponse<ActionHandler>To delete the notes of a record.
getNoteAPIResponse<ResponseHandler>To get the details of a specific note.
updateNoteAPIResponse<ActionHandler>To update the details of an existing note.
deleteNoteAPIResponse<ActionHandler>To delete a specific note.

Notification Operations

MethodReturn TypeDescription
enableNotificationsAPIResponse<ActionHandler>To enable instant notifications of actions performed on a module.
getNotificationDetailsAPIResponse<ResponseHandler>To get the details of the notifications enabled by the user.
updateNotificationsAPIResponse<ActionHandler>To update the details of the notifications enabled by a user. All the provided details would be persisted and rest of the details would be removed.
updateNotificationAPIResponse<ActionHandler>To update only specific details of a specific notification enabled by the user. All the provided details would be persisted and rest of the details will not be removed.
disableNotificationsAPIResponse<ActionHandler>To stop all the instant notifications enabled by the user for a channel.
disableNotificationAPIResponse<ActionHandler>To disable notifications for the specified events in a channel.

Organization Operations

MethodReturn TypeDescription
getOrganizationAPIResponse<ResponseHandler>To get the details of your organization.
uploadOrganizationPhotoAPIResponse<ActionHandler>To upload a photo of your organization.

Profile Operations

ConstructorDescription
ProfilesOperations(OffsetDateTime ifModifiedSince)Creates a ProfilesOperations class instance with the value of the If-Modified-Since header.
MethodReturn TypeDescription
getProfilesAPIResponse<ResponseHandler>To get the list of profiles available for your organization.
getProfileAPIResponse<ResponseHandler>To get the details of a specific profile.

Query (COQL) Operation

MethodReturn TypeDescription
getRecordsAPIResponse<ResponseHandler>To get the records from a module through a COQL query.

Records Operations

MethodReturn TypeDescription
getRecordAPIResponse<ResponseHandler>To get a specific record from a module.
updateRecordAPIResponse<ActionHandler>To update a specific record in a module.
deleteRecordAPIResponse<ActionHandler>To delete a specific record from a module.
getRecordsAPIResponse<ResponseHandler>To get all records from a module.
createRecordsAPIResponse<ActioneHandler>To insert records in a module.
updateRecordsAPIResponse<ActionHandler>To update records in a module.
deleteRecordsAPIResponse<ActionHandler>To delete records from a module.
upsertRecordsAPIResponse<ActionHandler>To insert/update records in a module.
getDeletedRecordsAPIResponse<DeletedRecords
Handler>
To get the deleted records from a module.
searchRecordsAPIResponse<ActionHandler>To search for records in a module that match certain criteria, email, phone number, or a word.
convertLeadAPIResponse<ConvertActionHandler>To convert records(Leads to Contacts/Deals).
getPhotoAPIResponse<DownloadHandler>To get the photo of a record.
uploadPhotoAPIResponse<FileHandler>To upload a photo to a record.
deletePhotoAPIResponse<FileHandler>To delete the photo of a record.
massUpdateRecordsAPIResponse<MassUpdateAction
Handler>
To update the same field for multiple records in a module.
getMassUpdateStatusAPIResponse<MassUpdateAction
Handler>
To get the status of the mass update job scheduled previously.

Related List Operations

ConstructorDescription
RelatedListsOperations(String module)Creates a RelatedListsOperations class instance with the moduleAPIName.
MethodReturn TypeDescription
getRelatedListsAPIResponse<ResponseHandler>To get the details of all the related lists of a module.
getRelatedListAPIResponse<ResponseHandler>To get the details of a specific related list of a module.

Related Records Operations

ConstructorDescription
RelatedRecordsOperations(String relatedListAPIName, Long recordId, String moduleAPIName)Creates a RelatedRecordsOperations class instance with the relatedListAPIName, recordId, and moduleAPIName.
MethodReturn TypeDescription
getRelatedRecordsAPIResponse<ResponseHandler>To get list of records from the related list of a module.
updateRelatedRecordsAPIResponse<ActionHandler>To update the association/relation between the records.
delinkRecordsAPIResponse<ActionHandler>To delete the association between the records.
getRelatedRecordAPIResponse<ResponseHandler>To get the records from a specific related list of a module.
updateRelatedRecordAPIResponse<ActionHandler>To update the details of a specific record of a related list in a module.
delinkRecordAPIResponse<ActionHandler>To delete a specific record from the related list of a module.
getRelatedRecordsUsingExternalIdAPIResponse<ActionHandler>This method is used to get the related list records and print the response.
updateRelatedRecordsUsingExternalIdAPIResponse<ResponseHandler>This method is used to update the relation between the records and print the response.
deleteRelatedRecordsUsingExternalIdAPIResponse<ActionHandler>This method is used to delete the association between modules and print the response.
getRelatedRecordUsingExternalIdAPIResponse<ActionHandler>This method is used to get the single related list record and print the response

Role Operations

MethodReturn TypeDescription
getRolesAPIResponse<ResponseHandler>To get the list of all roles available in your organization.
getRoleAPIResponse<ResponseHandler>To get the details of a specific role.

Shared Records Operations

ConstructorDescription
ShareRecordsOperations(Long recordId, String moduleAPIName)Creates a ShareRecordsOperations class instance with the recordId and moduleAPIName.
MethodReturn TypeDescription
getSharedRecordDetailsAPIResponse<ResponseHandler>To get the details of a record shared with other users.
shareRecordAPIResponse<ActionHandler>To share a record with other users in the organization.
updateSharePermissionsAPIResponse<ActionHandler>To
  • Update the sharing permissions of a record granted to users as Read-Write, Read-only, or grant full access.

  • Revoke access given to users to a shared record.

  • Update the access permission to the related lists of the record that was shared with the user.

revokeSharedRecordAPIResponse<DeleteActionHandler>To revoke access to a shared record.

Tags Operations

MethodReturn TypeDescription
getTagsAPIResponse<ResponseHandler>To get the list of all tags in your organization.
createTagsAPIResponse<ActionHandler>To create tags.
updateTagsAPIResponse<ActionHandler>To update multiple tags.
updateTagAPIResponse<ActionHandler>To update a specific tag.
deleteTagAPIResponse<ActionHandler>To delete a specific tag from the module.
mergeTagsAPIResponse<ActionHandler>To merge two tags.
addTagsToRecordAPIResponse<RecordActionHandler>To add tags to a specific record.
removeTagsFromRecordAPIResponse<RecordActionHandler>To remove tags from a record.
addTagsToMultipleRecordsAPIResponse<RecordActionHandler>To add tags to multiple records.
removeTagsFromMultipleRecordsAPIResponse<RecordActionHandler>To remove tags from multiple records.
getRecordCountForTagAPIResponse<RecordActionHandler>To get the record count for a tag.

Taxes Operations

MethodReturn TypeDescription
getTaxesAPIResponse<ResponseHandler>To get the taxes of your organization.
createTaxesAPIResponse<ActionHandler>To add taxes to your organization.
updateTaxesAPIResponse<ActionHandler>To update the existing taxes of your organization.
deleteTaxesAPIResponse<ActionHandler>To delete multiple taxes from your organization.
getTaxAPIResponse<ResponseHandler>To get the details of a specific tax.
deleteTaxAPIResponse<ActionHandler>To delete a specific tax from your organization.

Territory Operations

MethodReturn TypeDescription
getTerritoriesAPIResponse<ResponseHandler>To get the list of all territories.
getTerritoryAPIResponse<ResponseHandler>To get the details of a specific territory.

Users Operations

MethodReturn TypeDescription
getUsersAPIResponse<ResponseHandler>To get the list of users in your organization.
createUserAPIResponse<ActionHandler>To add a user to your organization.
updateUsersAPIResponse<ActionHandler>To update the existing users of your organization.
getUserAPIResponse<ResponseHandler>To get the details of a specific user.
updateUserAPIResponse<ActionHandler>To update the details of a specific user.
deleteUserAPIResponse<ActionHandler>To delete a specific user from your organization.

Variable Groups Operations

MethodReturn TypeDescription
getVariableGroupsAPIResponse<ResponseHandler>To get the list of all variable groups available for your organization.
getVariableGroupByIdAPIResponse<ResponseHandler>To get the details of a variable group by its group ID.
getVariableGroupByAPINameAPIResponse<ResponseHandler>To get the details of a specific variable group by its API name.

Variables Operations

MethodReturn TypeDescription
getVariablesAPIResponse<ResponseHandler>To get the list of variables available for your organization.
createVariablesAPIResponse<ActionHandler>To add new variables to your organization.
updateVariablesAPIResponse<ActionHandler>To update the details of variables.
deleteVariablesAPIResponse<ActionHandler>To delete multiple variables.
getVariableByIdAPIResponse<ResponseHandler>To get the details of a specific variable by its unique ID.
updateVariableByIdAPIResponse<ActionHandler>To update the details of a specific variable by its unique ID.
deleteVariableAPIResponse<ActionHandler>To delete a specific variable.
getVariableForAPINameAPIResponse<ResponseHandler>To get the details of a variable by its API name.
updateVariableByAPINameAPIResponse<ActionHandler>To update the details of a variable by its API name.