サンプルコード - PHP SDK

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

RESTクライアントの演算

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

メソッド説明
getOrganizationDetailsTo fetch information about your CRM account organization.
getOrganizationInstanceTo fetch details of a dummy organization.
getCurrentUserTo fetch information about the user who is currently accessing Zoho CRM's data through your application.
getRecordInstanceTo get a dummy record.
getModuleInstanceTo fetch details of a dummy module.

組織の演算

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

メソッド説明
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.
getAllConfirmedUsersTo fetch the list of all the confirmed users in your CRM account.
getAllNotConfirmedUsersTo fetch the list of all the users who are not confirmed in your CRM account.
getAllDeletedUsersTo fetch the list of all the users who were deleted from your CRM account.
getAllAdminUsersTo fetch the list of all the users who have admin level permissions in your CRM account.
getAllActiveConfirmedAdminsTo fetch the list of all the active and confirmed 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.
getCurrentUserTo fetch information on the user who is currently accessing Zoho CRM's data through your app.
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 information about a particular role in your CRM account.
getRoleTo fetch information about a particular role in your CRM account.
getorgtaxesTo fetch the list of all organization taxes.
getOrganizationTaxTo fetch information about a particular organization tax.
createOrganizationTaxesTo create a new organization tax.
updateOrganizationTaxesTo update the details of a particular organization tax.
getRoleTo fetch information about a particular role in your CRM account.
deleteOrganizationTaxesTo delete all the taxes associated to the organization.
deleteOrganizationTaxTo delete a particular tax associated to the organization.
searchUsersByCriteriaTo search for records in a module based on a criteria specified by the user.
getNotesTo fetch the list of notes created for your organization.
createNotesTo create notes for your organization.
deleteNotesTo delete notes from your organization.
getVariablesTo fetch the list of variables created for your organization.
createVariablesTo create variables for your organization.
updateVariablesTo update variables created for your organization.
getVariableGroupsTo fetch information about the variable groups created for your organization.

タブの演算

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

メソッド説明
getAllFieldsTo fetch the list of all the fields that are available in a module.
getFieldDetailsTo fetch information about a particular field 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.
updateCustomViewTo update a custom view of a module.
getAllRelatedListsTo fetch the list of all the related lists that are available for a module.
getRelatedListDetailsTo fetch the list of all the related lists that are available for a module.
updateModuleSettingsTo update the settings of a module. Ex: territory, custom view, etc.
getRecordsTo fetch the list of all the records that are available in a module.
getRecordTo fetch information about a particular record 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.
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.
massUpdateRecordsTo update single field value for multiple records. Same value will get updated for all the mentioned records.
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.
addTagsToRecordsTo associate tags to records in a module.
removeTagsFromRecordsTo disassociate tags from records in a module.

データの演算

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

メソッド説明
createTo create a new record.
updateTo update an existing record.
deleteTo delete an existing record.
convertTo convert a record (Leads to Contacts/Deals).
getNotesTo fetch the notes that were attached to a record.
addNotesTo add a note 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.
addTagsTo add tags to a record.
removeTagsTo remove tags from a record.

メモの演算

これらのメソッドには、Zoho CRM内のデータのメモにアクセスしたり、修正したりするために、アプリケーション内で実行できる処理が含まれます。

メソッド説明
getAttachmentsOfNoteTo fetch all attachments of a note.
uploadAttachmentToNoteTo upload a note attachment to a record.
downloadAttachmentFromNoteTo download an attachment that was attached to a record.
deleteAttachmentFromNoteTo delete an attachment that was attached to a record.

変数の演算

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

メソッド説明
getVariableofGroupTo fetch information about a specific variable from a group 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.

カスタムビューの演算

これらのメソッドを使用すると、特定のカスタムビュー内のデータを取得できます。

メソッド説明
getrecordsTo fetch records in a custom view.