require ‘vendor/autoload.php’ |
use zcrmsdk\crm\setup\restclient\ZCRMRestClient; |
Operating System | Procedure |
Mac/Linux | Run the following command in your terminal: curl -sS https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx |
Windows | Click here to download the .exe file and install composer. |
composer require zohocrm/php-sdk |
Key | Description |
client_id, client_secret mandatory | You can get these details after registering your client. |
redirect_uri mandatory for a web based client | The redirect URI of your web-based PHP client application. |
currentUserEmail mandatory | It is the email ID of the current user. You can set it in two ways: a. Through the currentUserEmail key in the configuration associative array (or) b. Through the ZCRMRestClient::setCurrentUserEmailId({user_email_id}) line in the code. |
fileUploadUrl Mandatory when using the Bulk Write API | The value for this key must be https://content.zohoapis.com. |
applicationLogFilePath optional | The SDK automatically creates a file to store the log information. The absolute file path of the folder in which the system must create the log file must be specified. The default file name is the ZCRMClientLibrary.log. If not specified, the system creates the file inside the project. |
sandbox optional | Represents whether to make API calls from the sandbox account. true: Make the API calls from the sandbox account. false: Do not make the API calls from the sandbox account. This is the default value. |
apiBaseUrl optional | Represents the URL to make API calls. It denotes the domain of the user. The possible values are: www.zohoapis.com (default) www.zohoapis.eu www.zohoapis.com.cn |
apiVersion optional | Represents the API version. Specify the value as v2 (default). |
access_type optional | Specify the value as offline. There is no support for Online OAuth client in PHP SDK as of now. |
accounts_url optional | The accounts URL. Possible values are: https://accounts.zoho.com (default) |
persistence_handler_class optional | The implementation of ZohoOAuthPersistenceInterface |
token_persistence_path optional | The absolute path to the folder that contains zcrm_oauthtokens.txt file. This key is mandatory if you want to use file persistence. If you include this key, this method takes precedence over other persistence methods. |
persistence_handler_class_name optional | The name of the custom class for persistence. This key is available only in PHP SDK 2.0.7 and above versions. |
db_port optional | You can specify this key if you want to use DB persistence. The default value is 3306. |
db_username, db_password optional | Specify the username and password of your database. The default value for db_username is root. |
host_address optional | The address of the machine in which the MySQL server is running. The default value is 'localhost'. This key is available only in PHP SDK 2.0.7 and above versions. |
$configuration=array("client_id"=>"1000.xxxxxxxxxxx"","client_secret"=>"831bxxxxxxxxxxxx","redirect_uri"=>"","currentUserEmail"=>"patricia@zylker.com"); ZCRMRestClient::initialize($configuration); |
$configuration=array("client_id"=>"1000.xxxxxxxxxxx", "client_secret"=>"831bxxxxxxxxxxxx", "redirect_uri"=>"redirect_uri", "currentUserEmail"=>"patricia@zylker.com", "applicationLogFilePath"=>"absolute/path/to/folder", "sandbox"=>"false","apiBaseUrl"=>"www.zohoapis.com", "apiVersion"=>"v2","access_type"=>"offline", "accounts_url"=>"https://accounts.zoho.com", "persistence_handler_class"=>"absolute/file/path/to/persistence/implementation", "token_persistence_path"=>"absolute/path/to/folder/zcrm_oauthtokens.txt", //should not contain "zcrm_oauthtokens.txt" "persistence_handler_class_name"=>"Persistence_class_name", "fileUploadUrl"=>"https://content.zohoapis.com"); ZCRMRestClient::initialize($configuration); |
$configuration =array("client_id"=>"1000.xxxxxxxxxxx","client_secret"=>"831bxxxxxxxxxxxx","redirect_uri"=>"","currentUserEmail"=>"patricia@zylker.com"); ZCRMRestClient::initialize($configuration); $oAuthClient = ZohoOAuth::getClientInstance(); $grantToken = "paste_the_self_authorized_grant_token_here"; $oAuthTokens = $oAuthClient->generateAccessToken($grantToken); |
$configuration =array("client_id"=>"1000.xxxxxxxxxxx","client_secret"=>"831bxxxxxxxxxxxx","redirect_uri"=>"","currentUserEmail"=>"patricia@zylker.com"); ZCRMRestClient::initialize($configuration); |
Writer is a powerful online word processor, designed for collaborative work.