PHP SDK - An Overview

PHP SDK - An Overview

PHP SDK offers a way to create client PHP applications that can be integrated with Zoho CRM. This SDK makes the access and use of necessary CRM APIs with ease. In other words, it serves as a wrapper for the REST APIs, making it easier to use the services of Zoho CRM.

Note

The PHP SDK for Zoho CRM has been updated to the latest version (2.0.0). In case you require the documentation for the previous versions (1.x.x), you can view the PDF here.


A sample of how an SDK acts a middle ware or interface between Zoho CRM and a client PHP application.




PHP SDK allows you to
  • Exchange data between Zoho CRM and the client application where the CRM entities are modelled as classes.
  • CRM API equivalents are declared and defined as simple functions in your PHP application.
  • Push data into Zoho CRM, by accessing appropriate APIs of the CRM Service.
Environmental Setup

PHP SDK is installable through composer. Composer is a tool for dependency management in PHP. SDK expects the following from the client app.
  • Client app must have PHP 5.6 or above with  curl  extension enabled.
  • PHP SDK must be installed into client app though composer.
  • The function  ZCRMRestClient::initialize($configuration)  must be called on startup of app.
    • $configuration - Contains the configuration details as a key-value pair.
  • Token persistence handling (storing and utilizing the oauth tokens) can be done in three ways. File, DB and Custom persistence. To know more about that, refer to this page.

Using the SDK

Add the below line in your client app PHP files, where you would like to make use of PHP SDK.
  1. require ‘vendor/autoload.php’
Through this line, you can access all the functionalities of the PHP SDK. The name spaces of the class to be used must be included within the "use" statement.

For example: ZCRMRestclient class is being used, you must add the following:

  1. use zcrmsdk/crm/setup/restclient/ZCRMRestClient;




    • Related Articles

    • Release Notes - PHP SDK

      ZOHO CRM/PHP SDK 2.0.1 Install command composer require zohocrm/php-sdk:2.0.1 Notes Enhancement Tag names can contain spaces in between them, while associating with records. Tag names can be retrieved as "ZCRMTag" objects in records function. ZOHO ...
    • Installation - PHP SDK

      Install Composer(if not installed) Run this command to install the composer curl -sS  https://getcomposer.org/installer  | php To install composer on mac/ linux machine: https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx To install ...
    • Configuration - PHP SDK

      To access the CRM services through SDK, the client application must be first authenticated. This can be done by passing a key-value configuration pair to the initialization process. The $configuration array must be created. It will contain the ...
    • Initialization - PHP SDK

      The app would be ready to be initialized after defining the configuration array. The user can now proceed to generate the required tokens to run the app. The generation of the grant token can be done using two methods. Self-Client Redirection-based ...
    • Responses & Exceptions - PHP SDK

      Response Objects All the API calling methods will return one of the following responses, which serve as a wrapper objects for the Zoho CRM APIs' responses. Responses Description APIResponse Returns a single API response object. BulkAPIResponse ...