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;