Giter Club home page Giter Club logo

zoho's Introduction

Zoho

Latest Version on Packagist Software License Total Downloads

This package used to integrate with the new Zoho CRM

For a new package please visit - ZohoV3

Requirements

Installation

Add Zoho CRM to your composer file via the composer require command:

$ composer require asciisd/zoho

Or add it to composer.json manually:

"require": {
    "asciisd/zoho": "^1.0"
}

Zoho CRM service providers will be automatically registered using Laravel's auto-discovery feature.

Configuration

The default configuration settings set in config/zoho.php. Copy this file to your own config directory to modify the values. You can publish the config using this command:

$ php artisan zoho:install

You'll need to add the following variables to your .env file. Use the credentials previously obtained registering your application.

ZOHO_CLIENT_ID=
ZOHO_CLIENT_SECRET=
ZOHO_REDIRECT_URI=
ZOHO_CURRENT_USER_EMAIL=

please note that for ZOHO_REDIRECT_URI you need to put your app_url as it is in .env file suffixed by /zoho/oauth2callback for ex. https://asciisd.com/zoho/oauth2callback

Then, follow the next steps:

  1. Go to Zoho CRM Developer Console.
  2. ADD CLIENT Server-based Applications.
  3. Enter Client Name Any name you want
  4. Enter Homepage URL your base home url
  5. Enter Authorized Redirect URIs config('app.url') . /zoho/oauth2callback
  6. Go to your project location on terminal and enter
    php artisan zoho:authentication
  7. Copy the generated link and past it in the browser to complete the oAuth process.

Now Zoho CRM is ready to use.

Testing

before testing make sure to create file ZCRMClientLibrary.log on

tests/Fixture/Storage/oauth/logs/ZCRMClientLibrary.log

and put your zcrm_oauthtokens.txt on

tests/Fixture/Storage/oauth/tokens/zcrm_oauthtokens.txt

finally put your Env keys

ZOHO_CLIENT_ID=
ZOHO_CLIENT_SECRET=
ZOHO_REDIRECT_URI=
ZOHO_CURRENT_USER_EMAIL=

How to use

use ZOHO Facade like this

use Asciisd\Zoho\Facades\ZohoManager;

// we can now deals with leads module
$leads = ZohoManager::useModule('Leads');

this will return an instance of ZohoModules

Model Can be used like this:-

Available only starting from v1.1.0

add Zohoable as extended class like this:-

use Asciisd\Zoho\Zohoable;
use Asciisd\Zoho\CriteriaBuilder;

class Invoice extends Zohoable {
    
    // this is your Zoho module API Name
    protected $zoho_module_name = 'Payments';

    public function searchCriteria(){
        // you should return string of criteria that you want to find current record in crm with.
        //EX:
        return CriteriaBuilder::where('PaymentID', $this->payment_id)
                              ->andWhere('Order_ID', $this->order_id)
                              ->toString();
    }

    public function zohoMandatoryFields() {
        // you should return array of mandatory fields to create module from this model
        // EX:
        return ['Base_Currency' => $this->currency];
    }
}

so now you can use invoice like this

$invoice = \App\Invoice::find(1);

// to check if has zoho id stored on local database or not
$invoice->hasZohoId();

// to return the stored zoho id
$invoice->zohoId();

// that will search on zoho with provided criteria to find the record and associated your model with returned id if exist
// if you provided an `id` that will be used instead of searching on Zoho
$invoice->createOrUpdateZohoId($id = null);

// you can also send current model to zoho
// that wil use `zohoMandatoryFields` method to Serialize model to zohoObject
// Also you can pass additional fields as array to this method
$invoice->createAsZohoable($options = []);

Note: To use the Invoice like this, you must have the invoices table in your database just like you would for any Laravel model. This allows you to save data to the database and also be able to link it to the zohos table and use all the functions in Zohoable. Use the CRUD functions below if you do not intend to use the Zohoable model this way.

CRUD Can be used like this:-

READ

use Asciisd\Zoho\Facades\ZohoManager;

// we can now deals with leads module
$leads = ZohoManager::useModule('Leads');

// find record by it's ID
$lead = $leads->getRecord('3582074000002383003');

UPDATE

// find record by it's ID
$lead = $leads->getRecord('3582074000002383003');

// Set field with new value
$lead->setFieldValue('Last_Name', 'Ahmed');

// Then call update() method
$lead = $lead->update()->getData();

CREATE

// initiating a new empty instance of leads
$record = $leads->getRecordInstance();

// fill this instance with data
$record->setFieldValue('First_Name', 'Amr');
$record->setFieldValue('Last_Name', 'Emad');
$record->setFieldValue('Email', '[email protected]');
$record->setFieldValue('Phone', '012345678910');

// create the record into zoho crm then get the created instance data
$lead = $record->create()->getData();

DELETE

// find record by it's ID
$lead = $leads->getRecord('3582074000002383003');

$lead->delete();

SEARCH

Word
use Asciisd\Zoho\Facades\ZohoManager;

$records = ZohoManager::useModule('Leads')->searchRecordsByWord('word to be searched');
$first_record = $records[0];
Phone
use Asciisd\Zoho\Facades\ZohoManager;

$records = ZohoManager::useModule('Leads')->searchRecordsByPhone('12345678910');
$first_record = $records[0];
Email
use Asciisd\Zoho\Facades\ZohoManager;

$records = ZohoManager::useModule('Leads')->searchRecordsByEmail('[email protected]');
$first_record = $records[0];
Criteria
use Asciisd\Zoho\Facades\ZohoManager;

$records = ZohoManager::useModule('Leads')->searchRecordsByCriteria('(City:equals:NY) and (State:equals:Alden)');
$first_record = $records[0];
Custom
use Asciisd\Zoho\Facades\ZohoManager;

$records = ZohoManager::useModule('Leads')
                    ->where('City', 'NY')
                    ->andWhere('State','Alden')
                    ->search();

$first_record = $records[0];

you can also make CriteriaBuilder like this

use Asciisd\Zoho\CriteriaBuilder;
use Asciisd\Zoho\Facades\ZohoManager;

$builder = CriteriaBuilder::where('City', 'NY')->andWhere('State','Alden')->startsWith('City', 'N');
ZohoManager::useModule('Leads')->searchRecordsByCriteria($builder->toString());

International Versions

If you're using zoho.com, you don't have to change anything.

If you're using zoho.eu, add to .env:

ZOHO_ACCOUNTS_URL=https://accounts.zoho.eu
ZOHO_API_BASE_URL=www.zohoapis.eu

If you're using zoho.com.cn, add to .env:

ZOHO_ACCOUNTS_URL=https://accounts.zoho.com.cn
ZOHO_API_BASE_URL=www.zohoapis.com.cn

License

MIT License. Copyright (c) 2020, Asciisd

Support

Contact:
asciisd.com
[email protected]
+2-010-1144-1444

zoho's People

Contributors

aemaddin avatar ibmgeniuz avatar izorwebid avatar moghwan avatar stefnats avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

zoho's Issues

Possible to retrieve options from select field in CRM?

Hi there,

The package is really great so thanks for that. However, I have a quick question.

If a select field is setup in the CRM, is it possible to pull the options from there through this package? So that the CRM and the web form would remain in sync? Or do I need to manually enter this information?
I could not see anything about this in the how to use code so maybe it isn't possible but a confirmation would be appreciated. Thanks!

Token expire in hour

I have done setup in laravel for this. But I have to do authentication every day. how to persist the token in this. so after once i never have to generate manaully?

Guzzle 7

Any plan to update to guzzle 7?

Not allowing installation in a new Laravel 8 installation.

Error is:

Your requirements could not be resolved to an installable set of packages.

Problem 1
- Can only install one of: guzzlehttp/guzzle[7.0.1, 6.5.x-dev].
- Can only install one of: guzzlehttp/guzzle[6.5.x-dev, 7.0.1].
- Can only install one of: guzzlehttp/guzzle[6.5.x-dev, 7.0.1].
- asciisd/zoho v1.1.0 requires guzzlehttp/guzzle ^6.5 -> satisfiable by guzzlehttp/guzzle[6.5.x-dev].
- Installation request for asciisd/zoho ^1.1 -> satisfiable by asciisd/zoho[v1.1.0].
- Installation request for guzzlehttp/guzzle (locked at 7.0.1, required as ^7.0.1) -> satisfiable by guzzlehttp/guzzle[7.0.1].

Enhancement Request: Support for Pagination in getRecords Method and Implementation of Get Related Records API Call

I am working on a project involving a data service server for a mobile app. I am using the Zoho API via the Asciisd\Zoho package, version 1.2.10, within a Laravel 10 environment and PHP 8.1 (Sail).

Issue 1: Limitation in searchRecordsByCriteria Method

I am currently encountering a limitation with the searchRecordsByCriteria method, which restricts the results to 2000 records as per Zoho API documentation. To circumvent this, I attempted to use the getRecords method to leverage pagination with the next_page_token parameter. However, the next_page_token parameter is not present in the response of the getRecords method.

Code Example:


use Asciisd\Zoho\Facades\ZohoManager;


$records = ZohoManager::useModule('Leads')->searchRecordsByCriteria('(City:equals:NY) and (State:equals:Alden)',11,200);
//$records count is 0 because on page 11 on perPage 200 the call exeded the api limit of 2000
$first_record = $records[0];

Problem Description:

The searchRecordsByCriteria method is limited to 2000 records.
When using the getRecords method, the expected next_page_token for pagination is missing in the response, preventing me from retrieving subsequent pages of data.

Issue 2: Missing Method for Get Related Records

I also need to use the Get Related Records API call as described in the Zoho API documentation. However, there is no method available in the current library that facilitates this API call.

Problem Description:

There is no callable method in the library for the Get Related Records API.

Environment:

Library Version: 1.2.10
Framework: Laravel 10
PHP Version: 8.1
Development Environment: Sail

Priority:

No immediate priority.
Request:

Can you please add support for these features? Specifically:

Ensure the next_page_token parameter is included in the response of the getRecords method.
Implement a method to facilitate the Get Related Records API call.

How to return data only

$leads = ZohoManager::useModule('Leads')->searchRecordsByCriteria($builder->toString());
How do i return data only on this command?

On this command below, i can get data only.
$lead = $leads->getRecord('4470003000036452043')->getData();

how to retrieve lead id from response .

   $request = (object)$request;
	$leads = ZohoManager::useModule('Leads');
	$record = $leads->getRecordInstance();
	$record->setFieldValue('First_Name', $request->fname);
	$record->setFieldValue('Last_Name', $request->lname);
	$record->setFieldValue('Job_Title', $request->title);
	$record->setFieldValue('Email',$request->email);
	$record->setFieldValue('Phone',$request->phone);
	$record->setFieldValue('Company',$request->company);
	$record->setFieldValue('Country',$request->country);
	$record->setFieldValue('Product_Interest',implode(",", $request->product_interest));
	$record->setFieldValue('Lead_Type','Demo');
	$record->setFieldValue('Industry',$request->industry);
	$record->setFieldValue('Vehicle_Count',$request->vehicle_count);
	$record->setFieldValue('Fleet_Services',implode(",",$request->fleet_services));
	$record->setFieldValue('People_Count',$request->people_count);
	$record->setFieldValue('Workforce_Services',implode(",",$request->workforce_services));
	$record->setFieldValue('Demo_Schedule_Time',$request->date.' '.$request->timeoption);
	$lead = $record->create()->getData();
            $id = $lead->getEntityId();
	
	$event = ZohoManager::useModule('Events');
	$eventrecord = $event->getRecordInstance();
	$eventrecord->setFieldValue('Event_Title','Schedule A Demo');
	$eventrecord->setFieldValue('Start_DateTime','2021-07-16T14:32:23+05:30');
	$eventrecord->setFieldValue('End_DateTime','2021-07-16T15:32:23+05:30');
	$eventrecord->setFieldValue('What_Id',$id);
            //$eventrecord->setFieldValue('What_Id',$id);
            $event = $eventrecord->create()->getData();

HI above code is working fine when I m comment $eventrecord->setFieldValue('What_Id',$id);
whenever I uncomment this line I will get following error.

image

Related Lists

Hey guys, thanks for this package, ive got all the examples working just wondering how i would use the "Related Lists" REST 2.1 api.

For example i have an account with the id 3220021000035501093 and i want to get the notes related to that account i would call
http://www.zohoapis.com/crm/2.1/Accounts/3220021000035501093/Notes

and this returns the json in postman, but how do i make that url call using this package?

thanks

invalid client on auth callback

"""
HTTP/1.1 200
Server: ZGS
Date: Tue, 22 Jun 2021 14:19:23 GMT
Content-Type: application/json;charset=UTF-8
Content-Length: 26
Connection: keep-alive
Set-Cookie: b266a5bf57=a711b6da0e6cbadb5e254290f114a026; Path=/
X-Content-Type-Options: nosniff
X-XSS-Protection: 1
Set-Cookie: iamcsr=bde7fa44-9132-456b-be73-323907eaca6e;path=/;SameSite=None;Secure;priority=high
Set-Cookie: _zcsr_tmp=bde7fa44-9132-456b-be73-323907eaca6e;path=/;SameSite=Strict;Secure;priority=high
X-Frame-Options: SAMEORIGIN
Content-Language: en-US
Strict-Transport-Security: max-age=63072000

{"error":"invalid_client"}
"""

I already pass following data to .env file still get above error

ZOHO_CLIENT_ID=
ZOHO_CLIENT_SECRET=
ZOHO_REDIRECT_URI=
ZOHO_CURRENT_USER_EMAIL=
ZOHO_ACCOUNTS_URL=
ZOHO_API_BASE_URL=

No Tokens exist for the given user-identifier,Please generate and try again

I get an error like this

No Tokens exist for the given user-identifier,Please generate and try again

i use this code

public function zohoLead()
    {
        $module = \Asciisd\Zoho\Facades\Zoho::useModule('leads');
        dd($module->getRecords());
    }

or i must invoke ?

ZCRMRestClient::initialize($configuration);

before, i use this code and success

public function __construtc() {
//configuration here
}

public function zohoLead()
{
    $client = new RestClient(ZCRMRestClient::getInstance())
    $module = $client->useModule('leads');
    $records = $module->getRecords();
}

getResponseJSON for single record

Hello,
Thanks for the package. It really helps with my work. I realized that I could use for eg:

$contacts = ZohoManager::useModule('Contacts');
$contacts->getRecord($record_id)->getData();

This works well, however, if there are nested data, they are ignored and returned as

{
    ...
    "Nested_Item": {} 
}

NB: Though Nested_Item shows empty, it actually has data in it.

I think it is because the response ignores arrays in the array. I couldn't loop through with for each because the empty Nested_Item is also returned as a ZCRMRecord. I thought looping through and doing getData() on it was going to expand that, but nothing. I think the getResponseJSON() does this out of the box.

If you use eg:

$related = $record->getRelatedListRecords('deals');

You can then use

$related->getResponseJSON();

It returns

{
    ...
    "Nested_Item_With_Data": {
             data: {...}
      }
}

Is it possible to have such a response for getting a single item or if it already exists, can you please point me in the right direction?

Thanks in advance

{"error":"invalid_redirect_uri"}

Hi

I'm developing in my local and I get this error.
zcrmsdk\oauth\exception\ZohoOAuthException Caused by:'Exception while fetching access token from grant token - HTTP/1.1 200 Server: ZGS Date: Fri, 09 Jul 2021 20:24:55 GMT Content-Type: application/json;charset=UTF-8 Content-Length: 32 Connection: keep-alive Set-Cookie: b266a5bf57=a711b6da0e6cbadb5e254290f114a026; Path=/ X-Content-Type-Options: nosniff X-XSS-Protection: 1 Set-Cookie: iamcsr=72f9c209-1ad4-41c7-ac1f-418996842463;path=/;SameSite=None;Secure;priority=high Set-Cookie: _zcsr_tmp=72f9c209-1ad4-41c7-ac1f-418996842463;path=/;SameSite=Strict;Secure;priority=high X-Frame-Options: SAMEORIGIN Content-Language: en-US Strict-Transport-Security: max-age=63072000 {"error":"invalid_redirect_uri"}'

Missing /storage/app/zoho/oauth/logs/ZCRMClientLibrary.log

I'm getting an error whenever I attempt to use this package. Basically, asciisd/zoho is looking for a log file inside my container's file structure. This feels odd as other frameworks will create the files they need.

Does this happen for everyone? What are you doing to get around this error? I don't want to add "create the file ZCRMClientLibrary.log" to my build process - that feels like an anti-pattern. Thanks!

Here's the error message I'm seeing:
fopen(/var/www/myapp/storage/app/zoho/oauth/logs/ZCRMClientLibrary.log): failed to open stream: No such file or directory

Getting Error

Hi there,

I tried to run below code I'm getting error
$products = ZohoManager::useModule('Products')->getModuleInstance()->getRecords(['page' => $page, 'per_page' => 200])->getResponseJSON();

Error

message: "Undefined offset: 1", exception: "ErrorException",…}
exception: "ErrorException"
file: "/Applications/MAMP/htdocs/yamron/vendor/zohocrm/php-sdk-archive/src/crm/api/response/CommonAPIResponse.php"
line: 105
message: "Undefined offset: 1"

I'm using php 7.3.11 but for other team mate, working this code very well.

If you need more, plz let me know.

Error

Hi
I am getting Call to undefined method Asciisd\Zoho\ZohoModule::where() error when i try similar request below

$records = ZohoManager::useModule('Contacts')
->where('City', 'NY')
->andWhere('State','Alden')
->search();

how to use this?

can you give me a example to use this package. example get a lead or post a lead? thanks

Number of Records

is there a way to get the number of records (e.g. leads) ?
I'm planning to paginate my table.

Column `'zohoable_id'` cannot be null

@aemaddin I get Column 'zohoable_id' cannot be null when I try to use $leads->createOrUpdateZohoId($id); . Will there be any reason this is the case? Is that autogenerated or there is a way to set zohoable_id for each model.

Thank you

Getting $file must be string exception

When inserting records, getting below exception

Type of zcrmsdk\oauth\exception\ZohoOAuthException::$file must be string (as in class Exception) {"exception":"[object] (Symfony\Component\ErrorHandler\Error\FatalError(code: 0): Type of zcrmsdk\oauth\exception\ZohoOAuthException::$file must be string (as in class Exception) at /var/www/html/backend/vendor/zohocrm/php-sdk-archive/src/oauth/exception/ZohoOAuthException.php:4)

$record = new ZohoCrm();
$record->setValue('full_name', '');
$record->create(); // This triggeres the above exception.

Note: This is working from the local environment but fails in production or staging.

Error on to uploadAttachment

I'm trying to attach documents to a business, but I'm in error.
"Please check if the URL trying to access is a correct one"
The server path is correct, does anyone have any examples?

my code
/*Create Business in Zoho */
$potentialsZoho = ZohoManager::useModule('Potentials');
// dd($potentialsZoho->getRecords());
$record = $potentialsZoho->getRecordInstance();
$record->setFieldValue('Description', 'Created by Quote:' . $quotation->cod);
$record->setFieldValue('Deal_Name', 'Quotation:' . $quotation->cod);
$record->setFieldValue('Account_Name', $accountZoho->getEntityId());
$record->setFieldValue('Stage', 'Proposal Budget/Price');
$record->setFieldValue('Contact_Name', $clientsZoho->getEntityId());
$record->setFieldValue('Expected_Revenue', $order->create_at);
$record->setFieldValue('Type','New Business');
$record->setFieldValue('Lead_Source',getenv('APP_NAME'));

        $quotController = new QuotationsController();
       
        $quotController->printQuotation($quotation->id,true);
       // dd(realpath(str_replace("/\/", "/",public_path().'/pdf/quotation'.$quotation->id.'.pdf')));
        $record->uploadAttachment( (realpath(str_replace("/\/", "/",public_path().'/pdf/quotation'.$quotation->id.'.pdf'))));
        
        $potentialsZoho = $record->create()->getData();

zcrmsdk\crm\exception\ZCRMException: invalid query formed

I get an error and im not sure where did i go wrong.
here's my code:

private function getFundings($dealId)
 {
            $builder = CriteriaBuilder::where('Deal', $dealId)
                    ->andWhere('Merchant_Accepted', 'Yes')
                    ->andWhere('Position', '01');
            return ZohoManager::useModule('Fundings')->searchRecordsByCriteria($builder->toString());

 }

Zohoable Model "SQLSTATE[42S02]: Base table or view not found"

Hello, I have a Model called ZohoLead using the Zohoable Model. However, where I try to get data with it, I get the error below.

"message": "SQLSTATE[42S02]: Base table or view not found: 1146 Table 'table_name.zoho_leads' doesn't exist (SQL: select * from `zoho_leads` where `zoho_leads`.`id` = 1 limit 1)"

If you add protected $table = 'zohos', to the created model, it works but then it looks like ZohoLead::find(1) will give you the first item whether it is a lead or not.

The solution I find will be to add a global scope in the model to only search for items with type of ZohoLeads. .

Is there a better way of doing it?
Or am I missing something?

Thanks

php8

update php "^7.2|^8" to composer.json... por favor?

Dealing with invalid_redirect_uri

Good morning,

It took me while to figure out ZOHO_REDIRECT_URI is supposed to hold my own domains redirect url, not Zoho's. I ended up going through all the code of the projects code to find out. Maybe it could help people to clarify a little bit extra this in the readme.

image

Exception while retrieving tokens from persistence

I was really happy to found your package to use it with Zoho.
But sadly I'm getting an error when I'm trying to create a lead.

I was able to create the Client In zoho, including the self client in zoho.
On the console I can create the token with the php artisan zoho:grant ..... and I'm getting a "Zoho CRM has been set up successfully" message. So far so good.

When I use the Fascade, still everything is working
_use Asciisd\Zoho\Facades\Zoho;
$leads = Zoho::useModule('Leads');

When I want to create a lead, I'm getting a Exception while retrieving tokens from persistence.
When I go directly to the file (/app/zoho/oauth/tokens), I have the zcrm_oauthtokens.txt file, and it has data inside. Because of this I assume the token really was created.

The error "Exception while retrieving tokens from persistence" comes from the zoho php sdk.
When I google it, I find this in the zoho forum (https://help.zoho.com/portal/en/community/topic/no-tokens-exist-for-the-given-user-identifier-please-generate-and-try-again).

I also have tried to create a new token, but the same thing happens. It seams that it can't open the file zcrm_oauthtokens.txt . Do you have any idea or hints that could help me?
image

Workflows does not triggered

Hi,

Thanks for the package! I have one question regarding workflows that has been setup when a lead is created.

Is it possible to also trigger workflows when creating record using this package? Thanks!

`$this->response` is `false` in CommonAPIResponse class

Whenever I try to call the Zoho API via this package I get an Undefined array key 1 error from CommonAPIResponse.php (zohocrm/php-sdk-archive) due to a false value in the response.

Reading $this in the setResponseJSON method shows me many undefined vars

zcrmsdk\crm\api\response\BulkAPIResponse {[#2233 ▼]()
  -bulkData: null
  -status: null
  -info: null
  -bulkEntitiesResponse: null
  -httpStatusCode: 0
  -responseJSON: null
  -responseHeaders: null
  -code: null
  -message: null
  -details: null
  -response: false
  -apiName: null
}

I am currently running on localhost. Tried to setup on an environment with pretty URL and via php artisan serve. Both times authentication worked but the responses are the same no matter if I want to read or manipulate data.

Can we use COQL Query

Can we use COQL Query using this package?
I'm trying to query with CreatedTime.

$builder = CriteriaBuilder::where('Lead_Source', 'Facebook')->andWhere('createdTime',"20121-08-16T14:32:23+05:30",'starts_with');

The criteria above give me an error :

zcrmsdk\crm\exception\ZCRMException: invalid query formed in file /Users/jayomayan/GitHub/lendzi-partner-api/vendor/zohocrm/php-sdk-archive/src/crm/api/response/BulkAPIResponse.php on line 72

Using token in auto scaling group

Hi

I am wondering if any one can point me in the right direction.

We are adding in an auto scaling group using AWS, but need to make sure the token can be used across multiple servers or on any new server that are spun up automatically.

If the token is stored in a central repo or a central location, will the token work on different instances?

"invalid_client" on oauth-callback

Hi,

when generating the connection to Zoho CRM, i do the following steps:

  1. Create new Laravel Project (^8.0)
  2. composer require asciisd/zoho
  3. Fill out credentials in .env
  4. php artisan zoho:install
  5. php artisan zoho:authentication
  6. Login and click Accept
  7. Retrieve the following exception:
zcrmsdk\oauth\exception\ZohoOAuthException
zcrmsdk\oauth\exception\ZohoOAuthException Caused by:'Exception while fetching access token from grant token - HTTP/1.1 200 
 Server: ZGS
 Date: Thu, 01 Oct 2020 06:02:31 GMT
 Content-Type: application/json;charset=UTF-8
 Content-Length: 26
 Connection: keep-alive
 Set-Cookie: b266a5bf57=dcb92d0f99dd7421201f8dc746d54606; Path=/
 X-Content-Type-Options: nosniff
 X-XSS-Protection: 1
 Set-Cookie: iamcsr=3b99f999-eb8f-45eb-acf0-b6a2b0b878e4;path=/;SameSite=None;Secure;priority=high
 Set-Cookie: _zcsr_tmp=3b99f999-eb8f-45eb-acf0-b6a2b0b878e4;path=/;SameSite=Strict;Secure;priority=high
 X-Frame-Options: SAMEORIGIN
 Content-Language: en-US
 Strict-Transport-Security: max-age=63072000
 
 {"error":"invalid_client"}' in /home/250374/dbnynxpmbu/public_html/vendor/zohocrm/php-sdk/src/oauth/ZohoOAuthClient.php(69) #0 /home/250374/dbnynxpmbu/public_html/vendor/asciisd/zoho/src/Http/Controllers/ZohoController.php(17): zcrmsdk\oauth\ZohoOAuthClient->generateAccessToken('1000.8276d26dc4...') #1 [internal function]: Asciisd\Zoho\Http\Controllers\ZohoController->oauth2callback(Object(Asciisd\Zoho\Http\Requests\ZohoRedirectRequest)) #2 /home/250374/dbnynxpmbu/public_html/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): call_user_func_array(Array, Array) #3 /home/250374/dbnynxpmbu/public_html/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction('oauth2callback', Array) #4 /home/250374/dbnynxpmbu/public_html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(255): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Asciisd\Zoho\Http\Controllers\ZohoController), 'oauth2callback') #5 /home/250374/dbnynxpmbu/public_html/vendor/laravel/framework/src/Illuminate/Routing/Route.php(197): Illuminate\Routing\Route->runController() #6 /home/250374/dbnynxpmbu/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(691): Illuminate\Routing\Route->run() #7 /home/250374/dbnynxpmbu/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request)) #8 /home/250374/dbnynxpmbu/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #9 /home/250374/dbnynxpmbu/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(693): Illuminate\Pipeline\Pipeline->then(Object(Closure)) #10 /home/250374/dbnynxpmbu/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(668): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request)) #11 /home/250374/dbnynxpmbu/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(634): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route)) #12 /home/250374/dbnynxpmbu/public_html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(623): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request)) #13 /home/250374/dbnynxpmbu/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(166): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request)) #14 /home/250374/dbnynxpmbu/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request)) #15 /home/250374/dbnynxpmbu/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #16 /home/250374/dbnynxpmbu/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure)) #17 /home/250374/dbnynxpmbu/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #18 /home/250374/dbnynxpmbu/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure)) #19 /home/250374/dbnynxpmbu/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #20 /home/250374/dbnynxpmbu/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Illuminate\Http\Request), Object(Closure)) #21 /home/250374/dbnynxpmbu/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(87): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #22 /home/250374/dbnynxpmbu/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle(Object(Illuminate\Http\Request), Object(Closure)) #23 /home/250374/dbnynxpmbu/public_html/vendor/fruitcake/laravel-cors/src/HandleCors.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #24 /home/250374/dbnynxpmbu/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fruitcake\Cors\HandleCors->handle(Object(Illuminate\Http\Request), Object(Closure)) #25 /home/250374/dbnynxpmbu/public_html/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #26 /home/250374/dbnynxpmbu/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fideloper\Proxy\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure)) #27 /home/250374/dbnynxpmbu/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request)) #28 /home/250374/dbnynxpmbu/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(141): Illuminate\Pipeline\Pipeline->then(Object(Closure)) #29 /home/250374/dbnynxpmbu/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request)) #30 /home/250374/dbnynxpmbu/public_html/public/index.php(52): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request)) #31 {main}

I'm using zoho.eu

Not sure what i'm doing wrong, can you help?

No Tokens exist for the given user-identifier - zcrm_oathtokens.txt empty

Hi, thank you so much for this great package. I am having an issue with setting up. I followed your docs carefully (multiple times) and when I do php artisan zoho:install I do not get a config file in the config folder. So I copied the default one from your repo. But even after I authorize and copy/paste the URL, my token and log files are empty and I don't know what to do to get them filled with data so I can use the rest of the package. I get the error of "no tokens exist". I noticed that before, there were other issues related to this and they were resolved. From what I can see, all fixes in those issues are present on my installation. I'm on laravel 7.0 and cannot get this to work for the life of me. Is there any advice you can offer?

How to use getJsonRecords() with page number

Hello,

getJsonRecords() returns 200 results, although I have thousands of results that must be returned in a paginated format. How would I get onto the next page of results using getJsonRecords ?

I'm presuming it would be something like

ZohoManager::useModule('Deals')->getJsonRecords(["page" => 1]);

But this doesn't work of course, since the function doesn't accept variables.

Any help would be appreciated!

get more than 200 records using getRecords()

Hi,

I'm trying to retrieve all my modules data using:

$data = ZohoManager::useModule($module_name)->getRecords()

But I only get the first 200 of the entries, is it possible to specify page and perpage values for getRecords()?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.