Hi,
I use the SDK of zoho in Laravel 5.8, i use the first method :
ZCRMRestClient::initialize($this->configuration);
and works fine, then i generate the grant token and use the next method:
$grant_token="1000.asdfgzxcvsdfre234324"
$oAuthClient = ZohoOAuth::getClientInstance();
$oAuthTokens = $oAuthClient->generateAccessToken($grant_token);
Laravel return me this error:
ErrorException (E_NOTICE)
Undefined index: Email
This error is generated for the method of the SDK
/home
/vagrant
/code
/xxxxx
/vendor
/zohocrm
/php-sdk
/src
/oauth
/ZohoOAuthClient.php
-
- /**
- * zohoOAuthParams
- *
- * @param $zohoOAuthParams
- */
- public function setZohoOAuthParams($zohoOAuthParams)
- {
- $this->zohoOAuthParams = $zohoOAuthParams;
- }
-
- public function getUserEmailIdFromIAM($accessToken)
- {
- $connector = new ZohoOAuthHTTPConnector();
- $connector->setUrl(ZohoOAuth::getUserInfoURL());
- $connector->addHeadder(ZohoOAuthConstants::AUTHORIZATION, ZohoOAuthConstants::OAUTH_HEADER_PREFIX . $accessToken);
- $apiResponse = $connector->get();
- $jsonResponse = self::processResponse($apiResponse);
-
- return $jsonResponse['Email'];
- }
-
- public function processResponse($apiResponse)
- {
- list($headers, $content) = explode("\r\n\r\n", $apiResponse, 2);
- $jsonResponse = json_decode($content, true);
-
- return $jsonResponse;
- }
- }
-
Arguments
But, when i use Post for generate the token works fine, y use this vars: (the values is only for demo)
private $configuration = [
"client_id" => "1000.IGIP62CIE7F1119417BO9W4111111111",
"client_secret" => "180abbdcda6af557726d389ee36db88111111",
"currentUserEmail" => "myemail@domain.com"
];
I need to send some additional parameter? or is it an error in your SDK?
I use PHP 7.2 with laravel 5.8