PHP code example of deadmantfa / yii2-zoho-api-client

1. Go to this page and download the library: Download deadmantfa/yii2-zoho-api-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

deadmantfa / yii2-zoho-api-client example snippets


    'zoho-api-client-id' => '<ZOHO_API_CLIENT_ID>',
    'zoho-api-client-secret' => '<ZOHO_API_CLIENT_SECRET>',
    'zoho-organization-id' => '<ZOHO_ORGANIZATION_ID>',
    'zoho-redirect-uri' => '<YOUR_DOMAIN_NAME>/zoho/default/auth?authclient=zoho'

    'modules' => [
        'zoho' => [
            'class' => \deadmantfa\yii2\zoho\Module::class,
        ],
    ],
    'components' => [
        'authClientCollection' => [
            'class' => \yii\authclient\Collection::class,
            'clients' => [
                'zoho' => [
                    'class' => \deadmantfa\yii2\zoho\auth\ZohoAuthClient::class,
                    'clientId' => $params['zoho-api-client-id'],
                    'clientSecret' => $params['zoho-api-client-secret'],
                    'returnUrl' => $params['zoho-redirect-uri'],
                ],
            ],
        ],
        'zoho'=> [
            'class' => \deadmantfa\yii2\zoho\components\ZohoApiClient::class,
            'apiBaseUrl'=>'https://inventory.zoho.com/api/v1/',
            'organizationId'=>$params['zoho-organization-id']
        ]
    ];  


use yii\console\controllers\MigrateController;

    'controllerMap' => [
        'migrate' => [
            'class' => MigrateController::class,
            'migrationPath' => [
                '@app/migrations',
                '@yii/rbac/migrations', // Just in case you forgot to run it on console (see next note)
            ],
            'migrationNamespaces' => [
                'deadmantfa\yii2\zoho\migrations',
            ],
        ],
    ],

Yii::$app->zoho->get('items', []);
Yii::$app->zoho->post('items', []);
Yii::$app->zoho->put('items', []);
Yii::$app->zoho->delete('items', []);
shell script
./yii migrate