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.
Attachment Operations
Constructor | Description |
---|
AttachmentsOperations($moduleAPIName, $recordId) | Creates an AttachmentsOperations class instance with the moduleAPIName and recordId. |
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 |
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. |
Fields Metadata Operations
Constructor | Description |
---|
FieldsOperations($module) | Creates a FieldsOperations class instance with the module. |
Method | Description |
---|
getFields | To get the meta details of all fields in a module. |
getField | To get the meta details of specific field in a module. |
Files Operations
Method | Description |
---|
uploadFiles | To upload files and get their encrypted IDs. |
getFile | To get the uploaded file through its encrypted ID. |
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. |
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. |
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. |
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. |
Role Operations
Method | Description |
---|
getRoles | To get the list of all roles available in your organization. |
getRole | To get the details of a specific role. |
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 | ToUpdate 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.
|
revokeSharedRecord | To revoke access to a shared record. |
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