Attachment API

use Asad\Zoho\Api\AttachmentApi;

$attach_api = new AttachmentApi();
  • List Of Attachments
$response = $attach_api->getAttachmentList($module_name, $record_id);
  • Upload An Attachment
$attachment = [
    'multipart' => [
        [
            'name' => 'attachmentUrl',
            'contents' => 'image_url', //put image url here
        ]
    ]
];
$response = $attach_api->uploadAttachment($module_name, $record_id, $attachment);
  • Download an Attachment
$response = $attach_api->downloadAttachment($module, $record_id, $attachment_id)
  • Delete an Attachment
$response = $attach_api->deleteAttachment($module, $record_id, $attachment_id)
  • Upload Images
$param = [
    'multipart' => [
        [
            'name' => 'file',
            'contents' => fopen('image_absolute_path', 'r'), //contents should be (StreamInterface/resource/string, required)
        ]
    ]
];
$response = $attach_api->uploaImages($module, $record_id, $param)
  • Download a Photo
$response = $attach_api->downloadImages($module, $record_id)
  • Download a Photo
$response = $attach_api->deleteImages($module, $record_id)

Meta Data API

use Asad\Zoho\Api\MetadataApi;

$meta_api = new MeatadataApi();
  • Module Meta Data
$response = $meta_api->getModuleMeta($module_name);
  • Fields Meta Data
$response = $meta_api->getFieldMeta($module_name);
  • Layouts
$response = $meta_api->getLayoutMeta($module_name);
  • Specific Layout Meta Data
$response = $meta_api->getLayoutMetaById($module_name, $layout_id);
  • Get List Of Modules(include in metadata)
$response = $meta_api->getModules();

Note API

use Asad\Zoho\Api\NoteApi;

$note_api = new NoteApi();
  • Get Notes
$response = $note_api->getNotes();
  • Get Notes From a Specific Record
$response = $note_api->getSpecificNote($module, $record_id);
  • Create Notes
$param = [
    'data' => [
        [
            "Note_Title": "Contacted",
            "Note_Content": "Need to do further tracking",
            "Parent_Id": "412963000001376069",
            "se_module": "Leads"
        ],
    ],
];
$response = $note_api->createNotes($param);
  • Create Specific Notes
$param = [
    'data' => [
        [
            "Note_Title": "Contacted",
            "Note_Content": "Need to do further tracking",
        ],
    ],
];
$response = $note_api->createSpecificNote($module, $parent_id, $param);
  • Update Notes
$param = [
    'data' => [
        [
            "Note_Title": "Contacted",
            "Note_Content": "Tracking done. Happy with the customer"
        ],
    ],
];
$response = $note_api->updateNote($module, $parent_id, $note_id, $param);
  • Delete Specific Notes
$response = $note_api->deleteSpecificNote($module, $parent_id, $note_id);

Query API

use Asad\Zoho\Api\QueryApi;

$query_api = new QueryApi();
  • Get Records through a COQL Query
$query = [
    "select_query" => "SELECT Company, Lead_Source FROM Leads WHERE Modified_Time > '".date('c', strtotime('2019-08-22 12:23:12'))."' LIMIT 100"

];
$response = $query_api->getRecordsByQuery($query);

Record API

use Asad\Zoho\Api\RecordApi;

$record_api = new RecordApi();
  • List of Records
$param = [
    'headers' => [
        'If-Modified-Since' => date('c', strtotime(date('Y-m-d H:i:s')))
    ],
    'data' => [
        'fields' => 'Email,Last_Name',
        'page' => 1,
        'per_page' => 100
    ]
];
$response = $record_api->listOfRecords($module_name, $param);
  • Get Specific Record
$response = $record_api->recordById($module_name, $record_id);
  • Insert Records
$param = [
    'data' => [
        [
            'Last_Name' => 'Rahman',
        ],
    ],
    'trigger' => [
        'workflow'
    ]
];
$response = $record_api->insert($module_name, $param);
  • Bulk Update Records
$param = [
    'data' => [
        [
            'id' => '', #record_id
            'Last_Name' => 'New Last Name',
        ],
        [
            'id' => '', #record_id
            'Last_Name' => 'Update Last Name',
        ]
    ],
    'trigger' => [
        'workflow'
    ]
];
$response = $record_api->bulkUpdate($module_name, $param);
  • Update Single Record
$param = [
    'data' => [
        [
            'Last_Name' => 'Single Record Update',
        ]
    ],
    'trigger' => [
        'workflow'
    ]
];
$response = $record_api->update($module_name, $record_id, $param);
  • Upsert Records
$param = [
    'data' => [
        [
            'Last_Name' => 'Upsert Check',
            'Email' => 'a@b.com',
        ]
    ],
    'duplicate_check_fields' => [
        'Email'
    ],
    'trigger' => [
        'workflow'
    ]
];
$response = $record_api->upsert($module_name, $param);
  • Bulk Delete Records
$param = [
    '', //record_id
    '', //record_id
];
$response = $record_api->bulkDelete($module_name, $param);
  • Delete Specific Record
$response = $record_api->delete($module_name, $record_id);
  • Search Records
$criteria = [
    'criteria' => '(Email:equals:a@b.com)'
];
$response = $record_api->search($module_name, $criteria);

RelatedList API

use Asad\Zoho\Api\RelatedListApi;

$relatedlist_api = new RelatedListApi();
  • Get Related Records
$related_list = 'Deals';
$response = $relatedlist_api->getRelatedRecords($module_name, $record_id, $related_list);
  • Update Related Records
$param = [
    'data' => [
        [
            'Member_Status' => 'Sent',
        ]
    ]
];
$related_list = 'Deals';
$response = $relatedlist_api->updateRelatedList($module_name, $record_id, $related_list, $related_record_id, $param);
  • Delink
$related_list = 'Deals';
$response = $relatedlist_api->removeRelatedList($module, $record_id, $related_list, $related_record_id);

Tag API

use Asad\Zoho\Api\TagApi;

$tag_api = new TagApi();
  • Get Tags
$response = $tag_api->getTagList($module_name);
  • Create New Tags
$param = [
    'tags' => [
        [
            "name" => "Book"
        ],
        [
            "name" => "Sales"
        ]
    ]
];
$response = $tag_api->createTags($module_name, $param);
  • Update a Specific Tag
$param = [
    'tags' => [
        [
            "name" => "Books"
        ]
    ]
];
$response = $tag_api->updateTags($module_name, $tag_id, $param);
  • Delete Tags
$response = $tag_api->removeTags($tag_id);
  • Add Tags To a Specific Record
$param = [
    'Books', //Tag name
    'Tech', //Tag name
];
$response = $tag_api->createSpecificRecordTags($module, $record_id, $param);
  • Remove Tags From a Specific Record
$param = [
    'Books', //Tag name
];
$response = $tag_api->removeSpecificRecordTags($module, $record_id, $param);