PHPackages                             zohocorporation/office-integrator-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. zohocorporation/office-integrator-sdk

ActiveSdk[API Development](/categories/api)

zohocorporation/office-integrator-sdk
=====================================

PHP SDK for Zoho Office Integrator

v1.0.2(11mo ago)013Apache-2.0PHPPHP &gt;=7.0

Since Dec 2Pushed 11mo agoCompare

[ Source](https://github.com/zoho/office-integrator-php-sdk)[ Packagist](https://packagist.org/packages/zohocorporation/office-integrator-sdk)[ Docs](https://www.zoho.com/officeplatform/integrator)[ RSS](/packages/zohocorporation-office-integrator-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

[ ![](https://camo.githubusercontent.com/e7efeb679c251e0361ca4a51b36e0afd30100b89d4c0066e618223c5b174c4bb/68747470733a2f2f7777772e7a6f686f7765627374617469632e636f6d2f73697465732f7a7765622f696d616765732f70726f647563746c6f676f732f6f6666696365696e7465677261746f722e737667)](https://zoho.com/catalyst/)PHP SDK
=======

[](#php-sdk)

[![PHP Version](https://camo.githubusercontent.com/bee71bebd50d4d033066f732eb0d4ba87b26a414f632d79db0ef5171e2c5e77e/68747470733a2f2f706f7365722e707567782e6f72672f7a6f686f636f72706f726174696f6e2f6f66666963652d696e7465677261746f722d73646b2f726571756972652f706870)](https://packagist.org/packages/zohocorporation/office-integrator-sdk)[![Downloads](https://camo.githubusercontent.com/4877538b853e128044725c60480922352cfa294d1e8d105f163783ae9dc54f12/68747470733a2f2f706f7365722e707567782e6f72672f7a6f686f636f72706f726174696f6e2f6f66666963652d696e7465677261746f722d73646b2f642f746f74616c2e737667)](https://packagist.org/packages/zohocorporation/office-integrator-sdk) [![License](https://camo.githubusercontent.com/5cf3a1c80b5bc2ece00922f46a8dfe00a001b6569be6c00210abbfe4ebcfe641/68747470733a2f2f706f7365722e707567782e6f72672f7a6f686f636f72706f726174696f6e2f6f66666963652d696e7465677261746f722d73646b2f6c6963656e73652e737667)](https://packagist.org/packages/zohocorporation/office-integrator-sdk)

Table Of Contents
-----------------

[](#table-of-contents)

- [Getting Started](#getting-Started)
- [Registering a Zoho Office Integrator APIKey](#registering-a-zoho-office-integrator-apikey)
- [Environmental Setup](#environmental-setup)
- [Including the SDK in your project](#including-the-sdk-in-your-project)
- [Configuration](#configuration)
- [Initialization](#initializing-the-application)
- [Sample Code](#sdk-sample-code)
- [License](#license)

Getting Started
---------------

[](#getting-started)

Zoho Office Integrator PHP SDK used to help you quickly integrator Zoho Office Integrator editors in side your web application.

Registering a Zoho Office Integrator APIKey
-------------------------------------------

[](#registering-a-zoho-office-integrator-apikey)

Since Zoho Office Integrator APIs are authenticated with apikey, you should register your with Zoho to get an apikey. To register your app:

- Visit this page [https://officeintegrator.zoho.com/](https://officeintegrator.zoho.com). ( Sign-up for a Zoho Account if you don't have one)
- Enter your company name and short description about how you are going to using zoho office integrator in your application. Choose the type of your application(commerial or non-commercial) and generate the apikey.
- After filling above details, create an account in Zoho Office Integrator service and copy the apikey from the dashboard.

Environmental Setup
-------------------

[](#environmental-setup)

PHP SDK is installable through **composer**. **composer** is a tool for dependency management in PHP. Composer installs PHP sdk in your application from **[packagist](https://packagist.org/packages/zohocorporation/office-integrator-sdk)**.

- Client app must have PHP(version 7.0 and above)
- composer must be installed in your machine

Including the SDK in your project
---------------------------------

[](#including-the-sdk-in-your-project)

You can include the SDK to your project using:

- Install **composer** from [getcomposer.org](https://getcomposer.org/download/) (if not installed).
- Install **PHP SDK**

    - Navigate to the workspace of your client app.
    - Create a composer.json in your application add [**zohocorporation/office-integrator-sdk**](https://packagist.org/packages/zohocorporation/office-integrator-sdk) in dependency list. [Example](https://github.com/zoho/office-integrator-php-sdk-examples/blob/main/composer.json#L15)
    - Now run the command below:

    ```
    composer install
    ```
- The PHP SDK will be installed and a package named **./zohocorporation/office-integrator-sdk.**\*\* will be created in your work space under the vendor folder.

Configuration
-------------

[](#configuration)

Before you get started with creating your PHP application, you need to register with Zoho Office Integrator to get an apikey for authentication.

- Configure **API environment** which decides the domain and the URL to make API calls.

    ```
    /*
     * Refer this help page for api end point domain details -  https://www.zoho.com/officeintegrator/api/v1/getting-started.html
    */
    $environment = new Production("https://api.office-integrator.com");
    ```
- Use below script to configure your apikey that you get from [Zoho Office Integrator](https://officeintegrator.zoho.com) dashboard.

    ```
    /**
     * You can configure where the apikey needs to added in the request object.
     * User can either pass the apikey in the addParam or addHeader method
     */
    $authBuilder = new AuthBuilder();
    $authentication = new Authentication();
    $authBuilder->addParam("apikey", "2ae438cf864488657cc9754a27daa480");
    $authBuilder->authenticationSchema($authentication->getTokenFlow());
    $tokens = [ $authBuilder->build() ];
    ```
- Create an instance of **Logger** Class to log exception and API information. By default, the SDK constructs a Logger instance with level - INFO and file\_path - (sdk\_logs.log parallel to node\_modules)

    ```
    /*
    * Create an instance of Logger Class that requires the following
    * level -> Level of the log messages to be logged. Can be configured by typing Levels "." and choose any level from the list displayed.
    * filePath -> Absolute file path, where messages need to be logged.
    */
    $logger = (new LogBuilder())
            ->level(Levels::INFO)
            ->filePath("./sdk_logs.log")
            ->build();
    ```

Initializing the Application
----------------------------

[](#initializing-the-application)

Initialize the SDK using the following code.

```
