サンプルコード - Python SDK

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

RESTクライアントの演算

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

メソッド説明
get_org_detailsTo fetch information about your CRM account organization.
get_current_userTo fetch information about the user who is currently accessing Zoho CRM's data through your application.
get_all_modulesTo fetch information about all modules in your CRM account.
get_moduleTo fetch information about a particular module in your CRM account.

組織の演算

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

メソッド説明
get_userTo fetch information about a specific user in your CRM account.
get_all_usersTo fetch the list of all the users from your CRM account.
get_all_active_usersTo fetch the list of all the active users in your CRM account.
get_all_deactive_usersTo fetch the list of all the non-active users in your CRM account.
get_all_active_confirmed_usersTo fetch the list of all the active and confirmed users in your CRM account.
get_all_confirmed_usersTo fetch the list of all the confirmed users in your CRM account.
get_all_not_confirmed_usersTo fetch the list of all the users who are not confirmed in your CRM account.
get_all_deleted_usersTo fetch the list of all the users who were deleted from your CRM account.
get_all_admin_usersTo fetch the list of all the users who have admin level permissions in your CRM account.
get_all_active_confirmed_admin_usersTo fetch the list of all the active and confirmed users who have admin level permissions in your CRM account.
create_userTo create a new user in your CRM account.
update_userTo update details of an existing user in your CRM account.
delete_userTo delete a user from your CRM account.
get_current_userTo fetch information on the user who is currently accessing Zoho CRM's data through your app.
get_profilesTo fetch the list of all the profiles that were created in your CRM account.
get_profileTo fetch information about a particular profile in your CRM account.
get_all_rolesTo fetch information about a particular role in your CRM account.
get_roleTo fetch information about a particular role in your CRM account.
get_variable_groupsTo get the details of any variable group.
get_variablesTo retrieve all the available variables for your organization.
create_variablesTo create new variables in CRM.
update_variablesTo update the details of variables in CRM.
get_organization_taxesTo fetch the list of all organization taxes.
get_organization_taxTo fetch information about a particular organization tax.
create_organization_taxesTo create a new organization tax.
update_organization_taxesTo update the details of a particular organization tax.
delete_organization_taxesTo delete all the taxes associated to the organization.
delete_organization_taxTo delete a particular tax associated to the organization.

タブの演算

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

メソッド説明
get_fieldsTo fetch the list of all the fields that are available in a module.
get_fieldTo fetch information about a particular field available in a module.
get_layoutTo fetch information about a particular layout of a module.
get_all_layoutsTo fetch the list of all the layouts that are available for a module.
get_customviewTo fetch information about a particular custom view of a module.
get_all_customviewsTo fetch the list of all the custom views that are available for a module.
get_all_relatedlistsTo fetch the list of all the related lists that are available for a module.
get_relatedlistTo fetch the list of all the related lists that are available for a module.
update_module_settingsTo update the settings of a module. Ex: territory, custom view, etc.
get_recordsTo fetch the list of all the records that are available in a module.
search_recordsTo search for records in a module based on a Word(text).
search_records_by_phoneTo search for records in a module based on the Phone number.
search_record_emailTo search for records in a module based on Email address.
search_records_by_criteriaTo search for records in a module based on a criteria specified by the user.
update_recordsTo update details of multiple records in a module.
create_recordsTo create a new record in a module.
delete_recordsTo delete existing records from a module.
get_deleted_recordsTo fetch the list of all the records that were deleted from a module.
get_recyclebin_recordsTo fetch the list of all the records that were deleted from a module and stored in the recycle bin.
get_permanently_deleted_recordsTo fetch the list of all the records that were permanently deleted from a module.
upsert_recordsTo insert/update records in a module.
mass_update_recordsTo update single field value for multiple records. Same value will get updated for all the mentioned records.
get_tagsTo fetch the list of all the tags that were created for a module.
get_tag_countTo fetch the total count of tags that were created for a module.
create_tagsTo create new tags for a module.
update_tagsTo update the details of existing tags for a module.
add_tags_to_multiple_recordsTo associate tags to records in a module.
remove_tags_from_multiple_recordsTo disassociate tags from records in a module.

データの演算

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

メソッド説明
create_recordTo create a new record.
update_recordTo update an existing record.
delete_recordTo delete an existing record.
convert_recordTo convert a record (Leads to Contacts/Deals).
get_notesTo fetch the notes that were attached to a record.
add_noteTo add a note to a record.
update_noteTo update a note that was previously added to a record.
delete_noteTo delete a note from a record.
get_attachmentsTo fetch the list of attachments of a record.
upload_attachmentTo upload an attachment to a record.
upload_link_as_attachmentTo upload a link as an attachment to a record.
download_attachmentTo download an attachment that was uploaded to a record.
delete_attachmentTo delete an attachment that was added to a record.
upload_photoTo upload a photo to a record.
download_photoTo download a photo that was added to a record.
delete_photoTo delete a photo that was added to a record.
add_relationTo make a relation between two records.
remove_relationTo remove a relation between two records.
get_related_recordsTo fetch the list of records in a related list.
get_blueprintTo get the next available transitions for that record, fields available for each transition, current value of each field, and validation(if any).
update_blueprintTo update a single transition at a time.
get_variable_groupTo get the details of a specific variable group.
get_variableTo get the details of a specific variable.
update_variableTo update the details of a specific variable.
delete_variableTo delete a specific variable.
add_tagsTo add tags to a record.
remove_tagsTo remove tags from a record.
delete_tagTo remove tags from a record.
merge_tagTo merge two tags.

メモの演算

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

メソッド説明
note_get_attachmentsTo fetch all attachments of a note.
note_upload_attachmentTo upload a note attachment to a record.
note_download_attachmentTo download an attachment that was attached to a record.
note_delete_attachmentTo delete an attachment that was attached to a record.