thomas-kl1 / php-sdk-zoho-desk

PHP SDK for Zoho Desk API v1 integration.
MIT License
7 stars 10 forks source link

Could not fetch the entity - Laravel 8 #3

Closed JavierAgueroCL closed 3 years ago

JavierAgueroCL commented 3 years ago

I trying get all tickets from Zoho Account using Laravel 8, but I see this error:

Zoho\Desk\Exception\CouldNotReadException Could not fetch the entity.

This is my connection

Storage::disk('local')->put('zcrm_oauthtokens.txt','');
$location = Storage::disk('local')->path('/');
$configBuilder = ConfigProviderBuilder::getInstance();
$configBuilder->setClientId('1000.QOZCEYKN0CN08Jxxxxxxxxx')
->setClientSecret('c43e62092bf25de7c6322xxxxxxxxxxxxx')
->setRedirectUrl('http://localhost:8000/test')
->setCurrentUserEmail('someone@domain.com')
->setApiBaseUrl(Metadata::API_ENDPOINT_US)
->setApiVersion(Metadata::API_VERSION)
->setOrgId(123456789)
->setIsSandbox(false)
->setAccountsUrl(Metadata::API_ACCOUNTS_US)
->setTokenPersistencePath($location);
$gateway = new Gateway($configBuilder->create());
try {
    $criteriaBuilder = new ListCriteriaBuilder();
    // $criteriaBuilder->setFields()->setFilters()...
    $ticketList = $gateway->getOperationPool()->getListOperation('tickets')->getList($criteriaBuilder->create());
    //$ticketList = $gateway->getOperationPool()->getListOperation('tickets')->getByIds([1,2,3]);
} catch (CouldNotReadException $e) {
    // Handle the exception...
}
thomas-kl1 commented 3 years ago

Hi, please could you print the message of the previous exception of $e->getPrevious()->getMessage()?

thomas-kl1 commented 3 years ago

@LectorRSS did you generated the token the first time?