Sample Codes
All of Zoho CRM's APIs can be used through the PHP 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.
Assignment Operations
Method | Description |
---|---|
getAssignmentRules | To fetch the assignment rules of a record. |
getAssignmentRules | To fetch the assignment rule of a record. |
Attachment Operations
Constructor | Description |
---|---|
AttachmentsOperations($moduleAPIName, $recordId) | Creates an AttachmentsOperations class instance with the moduleAPIName and recordId. |
Method | Description |
---|---|
getAttachments | To fetch the list of attachments of a record. |
uploadAttachments | To upload attachments to a record. |
deleteAttachments | To delete the attachments that were added to a record. |
deleteAttachment | To delete an attachment that was added to a record. |
downloadAttachment | To download an attachment that was uploaded to a record. |
uploadLinkAttachments | To upload a link as an attachment to a record. |
Blueprint Operations
Constructor | Description |
---|---|
BluePrintOperations($recordId, $moduleAPIName) | Creates a BluePrintOperations class instance with the recordId and moduleAPIName. |
Method | Description |
---|---|
getBlueprint | To get the next available transitions for that record, fields available for each transition, current value of each field, and validation(if any). |
updateBlueprint | To update a single transition at a time. |
Bulk Read Operations
Method | Description |
---|---|
createBulkReadJob | To schedule a bulk read job to export records that match the criteria. |
getBulkReadJobDetails | To know the status of the bulk read job scheduled previously. |
downloadResult | 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
Method | Description |
---|---|
uploadFile | To upload a CSV file in ZIP format. The response contains the "file_id". Use this ID while making the bulk write request. |
createBulkWriteJob | 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. |
getBulkWriteJobDetails | To know the status of the bulk write job scheduled previously. |
downloadResult | To download the result of the bulk write 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 write read job |
Cancel Meeting Operation
Method | Description |
---|---|
CancelMeetingsOperations | To cancel a meeting. |
Contact Roles Operations
Method | Description |
---|---|
getContactRoles | To get the list of all contact roles. |
createContactRoles | To create contact roles. |
updateContactRoles | To update contact roles. |
deleteContactRoles | To delete contact roles. |
getContactRole | To get specific contact role. |
updateContactRole | To update specific contact role. |
deleteContactRole | To delete specific contact role. |
GetAllContactRolesOfDeal | To get all contact roles of deal. |
GetContactRoleOfDeal | To get contact role of deal. |
AddContactRoleToDeal | To add contact role to deal. |
RemoveContactRoleFromDeal | To remove specific contact role from deal. |
Currencies Operations
Method | Description |
---|---|
getCurrencies | To get the list of all currencies available for your org. |
addCurrencies | To add new currencies to your org. |
updateCurrencies | To update the currencies' details of your org. |
enableMultipleCurrencies | To enable multiple currencies for your org. |
updateBaseCurrency | To update the base currency details of your org. |
getCurrency | To get the details of specific currency. |
updateCurrency | To update the details of specific currency. |
Custom View Operations
Constructor | Description |
---|---|
CustomViewsOperations($module) | Creates a CustomViewsOperations class instance with the moduleAPIName. |
Method | Description |
---|---|
getCustomViews | To get the list of all custom views in a module. |
getCustomView | To get the details of specific custom view in a module. |
Email Templates Operations
Method | Description |
---|---|
getEmailTemplates | To fetch all the email templates. |
getEmailTemplateById | To fetch a particular email template. |
Field Attachment Operation
Method | Description |
---|---|
getFieldAttachments | To get all the field attachments. |
Fields Metadata Operations
Constructor | Description |
---|---|
FieldsOperations($module) | Creates a FieldsOperations class instance with the module. |
Files Operations
Method | Description |
---|---|
uploadFiles | To upload files and get their encrypted IDs. |
getFile | To get the uploaded file through its encrypted ID. |
Inventory Templates Operations
Method | Description |
---|---|
getInventoryTemplates | To fetch all the inventory templates. |
getInventoryTemplateById | To fetch a particular inventory template. |
Layouts Operations
Constructor | Description |
---|---|
LayoutsOperations($module) | Creates a LayoutsOperations class instance with the moduleAPIName. |
Method | Description |
---|---|
getLayouts | To get the details of all the layouts in a module. |
getLayout | To get the details (metadata) of a specific layout in a module. |
Modules Operations
Method | Description |
---|---|
getModules | To get the details of all the modules. |
getModule | To get the details (metadata) of a specific module. |
updateModuleByAPIName | To update the details of a module by its module API name. |
updateModuleById | To update the details of a module by its ID. |
Notes Operations
Method | Description |
---|---|
getNotes | To get the list of notes of a record. |
createNotes | To add new notes to a record. |
updateNotes | To update the details of the notes of a record. |
deleteNotes | To delete the notes of a record. |
getNote | To get the details of a specific note. |
updateNote | To update the details of an existing note. |
deleteNote | To delete a specific note. |
Notification Operations
Method | Description |
---|---|
enableNotifications | To enable instant notifications of actions performed on a module. |
getNotificationDetails | To get the details of the notifications enabled by the user. |
updateNotifications | 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. |
updateNotification | 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. |
disableNotifications | To stop all the instant notifications enabled by the user for a channel. |
disableNotification | To disable notifications for the specified events in a channel. |
Organization Operations
Method | Description |
---|---|
getOrganization | To get the details of your organization. |
uploadOrganizationPhoto | To upload a photo of your organization. |
Pipeline Operations
Method | Description |
---|---|
transferAndDelete | To transfer and delete. |
getPipelines | To get all the pipelines. |
createPipelines | To create pipelines. |
updatePipelines | To update pipelines. |
getPipeline | To get a particular pipeline. |
updatePipeline | To update pipeline. |
Profile Operations
Constructor | Description |
---|---|
ProfilesOperations($ifModifiedSince) | Creates a ProfilesOperations class instance with the value of the If-Modified-Since header. |
Method | Description |
---|---|
getProfiles | To get the list of profiles available for your organization. |
getProfile | To get the details of a specific profile. |
Query (COQL) Operation
Method | Description |
---|---|
getRecords | To get the records from a module through a COQL query. |
Records Operations
Method | Description |
---|---|
getRecord | To get a specific record from a module. |
updateRecord | To update a specific record in a module. |
deleteRecord | To delete a specific record from a module. |
GetRecordUsingExternalID | To get records using external ID. |
UpdateRecordUsingExternalID | To update records using external ID. |
DeleteRecordUsingExternalID | To delete records using external ID. |
getRecords | To get all records from a module. |
createRecords | To insert records in a module. |
updateRecords | To update records in a module. |
deleteRecords | To delete records from a module. |
upsertRecords | To insert/update records in a module. |
getDeletedRecords | To get the deleted records from a module. |
searchRecords | To search for records in a module that match certain criteria, email, phone number, or a word. |
convertLead | To convert records(Leads to Contacts/Deals). |
getPhoto | To get the photo of a record. |
uploadPhoto | To upload a photo to a record. |
deletePhoto | To delete the photo of a record. |
massUpdateRecords | To update the same field for multiple records in a module. |
getMassUpdateStatus | To get the status of the mass update job scheduled previously. |
Related List Operations
Constructor | Description |
---|---|
RelatedListsOperations($module) | Creates a RelatedListsOperations class instance with the moduleAPIName. |
Method | Description |
---|---|
getRelatedLists | To get the details of all the related lists of a module. |
getRelatedList | To get the details of a specific related list of a module. |
Related Records Operations
Constructor | Description |
---|---|
RelatedRecordsOperations($relatedListAPIName, $recordId, $moduleAPIName) | Creates a RelatedRecordsOperations class instance with the relatedListAPIName, recordId, and moduleAPIName. |
Method | Description |
---|---|
getRelatedRecords | To get list of records from the related list of a module. |
updateRelatedRecords | To update the association/relation between the records. |
delinkRecords | To delete the association between the records. |
GetRelatedRecordsUsingExternalId | To get the records using External ID. |
UpdateRelatedRecordsUsingExternalId | To update the association/relation between the records using External ID. |
DeletedRelatedRecordsUsingExternalId | To delete the association between the records using External ID. |
GetRelatedRecordUsingExternalId | To get the record using External ID. |
UpdateRelatedRecordUsingExternalId | To update the association/relation between the record using External ID. |
DeleteRelatedRecordsUsingExternalId | To delete the association between the record using External ID. |
getRelatedRecord | To get the records from a specific related list of a module. |
updateRelatedRecord | To update the details of a specific record of a related list in a module. |
Delink Record | To delete a specific record from the related list of a module. |
Role Operations
Send Mail Operations
Method | Description |
---|---|
getEmailAddresses | To get all the email addresses. |
sendMail | To send a mail. |
Shared Records Operations
Constructor | Description |
---|---|
ShareRecordsOperations($recordId, $moduleAPIName) | Creates a ShareRecordsOperations class instance with the recordId and moduleAPIName. |
Method | Description |
---|---|
getSharedRecordDetails | To get the details of a record shared with other users. |
shareRecord | To share a record with other users in the organization. |
updateSharePermissions | To
|
revokeSharedRecord | To revoke access to a shared record. |
Tags Operations
Method | Description |
---|---|
getTags | To get the list of all tags in your organization. |
createTags | To create tags. |
updateTags | To update multiple tags. |
updateTag | To update a specific tag. |
deleteTag | To delete a specific tag from the module. |
mergeTags | To merge two tags. |
addTagsToRecord | To add tags to a specific record. |
removeTagsFromRecord | To remove tags from a record. |
addTagsToMultipleRecords | To add tags to multiple records. |
removeTagsFromMultipleRecords | To remove tags from multiple records. |
getRecordCountForTag | To get the record count for a tag. |
Taxes Operations
Method | Description |
---|---|
getTaxes | To get the taxes of your organization. |
createTaxes | To add taxes to your organization. |
updateTaxes | To update the existing taxes of your organization. |
deleteTaxes | To delete multiple taxes from your organization. |
getTax | To get the details of a specific tax. |
deleteTax | To delete a specific tax from your organization. |
Territory Operations
Method | Return Type | Description |
---|---|---|
getTerritories | APIResponse<ResponseHandler> | To get the list of all territories. |
getTerritory | APIResponse<ResponseHandler> | To get the details of a specific territory. |
Users Operations
Method | Description |
---|---|
getUsers | To get the list of users in your organization. |
createUser | To add a user to your organization. |
updateUsers | To update the existing users of your organization. |
getUser | To get the details of a specific user. |
updateUser | To update the details of a specific user. |
deleteUser | To delete a specific user from your organization. |
Variable Groups Operations
Method | Description |
---|---|
getVariableGroups | To get the list of all variable groups available for your organization. |
getVariableGroupById | To get the details of a variable group by its group ID. |
getVariableGroupByAPIName | To get the details of a specific variable group by its API name. |
Variables Operations
Method | Description |
---|---|
getVariables | To get the list of variables available for your organization. |
createVariables | To add new variables to your organization. |
updateVariables | To update the details of variables. |
deleteVariables | To delete multiple variables. |
getVariableById | To get the details of a specific variable by its unique ID. |
updateVariableById | To update the details of a specific variable by its unique ID. |
deleteVariable | To delete a specific variable. |
getVariableForAPIName | To get the details of a variable by its API name. |
updateVariableByAPIName | To update the details of a variable by its API name. |
Wizards Operations
Method | Description |
---|---|
getWizards | To get the list of wizards available. |
getWizardById | To get a particular wizard. |