サンプルコード - Java SDK

Java SDKを通じて、すべてのZoho CRM APIを使用し、カスタムアプリケーションでデータ同期を実行できます。Java SDKで利用できるAPIメソッドのサンプルコードを紹介します。

RESTクライアントの演算

これらのメソッドには、Zoho CRMのデータにアクセスするために、アプリケーション内に含める認証手順が含まれます。

メソッド説明
getOrganizationDetailsTo fetch all the details regarding your organization in your CRM account.
getCurrentUserTo fetch information about the user who is currently accessing Zoho CRM's data through your application.
getCurrentUserEmailIDTo fetch the email ID of the user, who's is currently accessing CRM's data.
getAllModulesTo fetch the list of all the modules available in your CRM account.
getModuleTo fetch information about a particular module in your CRM account.

組織の演算

これらのメソッドには、Zoho CRMの組織のデータを取得するために、アプリケーション内で実行できる処理が含まれます。たとえば、組織内のすべてのユーザー(従業員)の一覧をいつでも取得できます。

メソッドDescription
getUserTo fetch information about a specific user in your CRM account.
getAllUsersTo fetch the list of all the users from your CRM account.
getAllActiveUsersTo fetch the list of all the active users in your CRM account.
getAllDeactiveUsersTo fetch the list of all the non-active users in your CRM account.
getAllActiveConfirmedUsersTo fetch the list of all the active and confirmed users in your CRM account.
getAllAdminUsersTo fetch the list of all the users who have admin level permissions in your CRM account.
createUserTo create a new user in your CRM account.
updateUserTo update details of an existing user in your CRM account.
deleteUserTo delete a user from your CRM account.
getAllProfilesTo fetch the list of all the profiles that were created in your CRM account.
getProfileTo fetch information about a particular profile in your CRM account.
getAllRolesTo fetch the list of all the roles that were created in your CRM account.
getRoleTo fetch information about a particular role in your CRM account.
getAllTaxesTo fetch the list of all organization taxes.
getTaxTo fetch information about a particular organization tax.
getVariablesTo fetch information about the variables created for your organization.
getVariableGroupsTo fetch information about the variable groups created for your organization.
createVariablesTo create new variables for your organization.
updateVariablesTo update the details of variables created for your organization.

タブの演算

これらのメソッドには、Zoho CRM内でタブ単位でデータを修正するために、アプリケーション内で実行できる処理が含まれます。たとえば、タブからすべてのデータを取得したり、特定のデータを検索したり、データを削除したりなどができます。

Note

SDK 1.x.xのupdateRecords()のメソッドは、バージョン2からmassUpdateRecords()に変更になりましたのでご注意ください。

メソッド説明
getAllFieldsTo fetch the list of all the fields that are available in a module.
getLayoutDetailsTo fetch information about a particular layout of a module.
getAllLayoutsTo fetch the list of all the layouts that are available for a module.
getCustomViewTo fetch information about a particular custom view of a module.
getAllCustomViewsTo fetch the list of all the custom views that are available for a module.
getAllRelatedListsTo fetch the list of all the related lists that are available for a module.
getRecordsTo fetch the list of all the records that are available in a module.
searchRecordsByWordTo search for records in a module based on a Word(text).
searchRecordsByPhoneTo search for records in a module based on the Phone number.
searchRecordsByEmailTo search for records in a module based on Email address.
searchRecordsByCriteriaTo search for records in a module based on a criteria specified by the user.
updateRecordsTo update details of multiple records in a module.
massUpdateRecordsTo update details of a single field across the given record IDs in a module.
createRecordsTo create a new record in a module.
deleteRecordsTo delete existing records from a module.
getAllDeletedRecordsTo fetch the list of all the records that were deleted from a module.
getRecycleBinRecordsTo fetch the list of all the records that were deleted from a module and stored in the recycle bin.
getPermanentlyDeletedRecordsTo fetch the list of all the records that were permanently deleted from a module.
upsertRecordsTo insert/update records in a module.
getTagsTo fetch the list of all the tags that were created for a module.
getTagCountTo fetch total count of the tags that were created for a module.
createTagsTo create new tags for a module.
updateTagsTo update details of existing tags for a module.
addTagMultipleRecordTo associate tags to records in a module.
removeTagMultipleRecordTo disassociate tags from records in a module.

データの演算

これらのメソッドには、特定のデータ内に保管されている詳細情報にアクセスしたり、詳細情報を修正したりするために、アプリケーション内で実行できる処理が含まれます。たとえば、データの詳細情報の取得、新しいデータの作成、既存データの更新、メモ/添付ファイル/写真のアップロードなどが可能です。

メソッド説明
createTo create new records.
updateTo update existing records.
deleteTo delete existing records.
convertTo convert records(Leads to Contacts/Deals).
getNotesTo fetch the notes that were attached to a record.
addNoteTo add a note to a record.
updateNoteTo update a note that was previously added to a record.
deleteNoteTo delete a note from a record.
getAttachmentsTo fetch the list of attachments of a record.
uploadAttachmentTo upload an attachment to a record.
uploadLinkAsAttachmentTo upload a link as an attachment to a record.
downloadAttachmentTo download an attachment that was uploaded to a record.
deleteAttachmentTo delete an attachment that was added to a record.
uploadPhotoTo upload a photo to a record.
downloadPhotoTo download a photo that was added to a record.
deletePhotoTo delete a photo that was added to a record.
addRelationTo make a relation between two records.
removeRelationTo remove a relation between two records.
addTagSpecificRecordTo add tags to a specific record.
removeTagSpecificRecordTo remove tags from a specific record.
getRelatedListRecordsTo get the list of related list records.

タグの演算

これらのメソッドを使用すると、CRM内でタグを追加したり、タグを削除したりできます 。

メソッド説明
updateTagTo update details of an existing tag.
deleteTagTo delete a tag.
mergeTagTo merge two tags.

変数の演算

これらのメソッドを使用すると、組織用の変数を更新したり、削除したりできます。

メソッド説明
getVariableTo fetch information about a specific variable created for your organization.
updateVariableTo update the details of a specific variable.
deleteVariableTo delete a specific variable.
getVariableGroupTo fetch information about a specific variable group created for your organization.