generateAccessToken Return Error: Undefined index: Email

generateAccessToken Return Error: Undefined index: Email

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
  1. /**
  2. * zohoOAuthParams
  3. *
  4. * @param $zohoOAuthParams
  5. */
  6. public function setZohoOAuthParams($zohoOAuthParams)
  7. {
  8. $this->zohoOAuthParams = $zohoOAuthParams;
  9. }
  10. public function getUserEmailIdFromIAM($accessToken)
  11. {
  12. $connector = new ZohoOAuthHTTPConnector();
  13. $connector->setUrl(ZohoOAuth::getUserInfoURL());
  14. $connector->addHeadder(ZohoOAuthConstants::AUTHORIZATION, ZohoOAuthConstants::OAUTH_HEADER_PREFIX . $accessToken);
  15. $apiResponse = $connector->get();
  16. $jsonResponse = self::processResponse($apiResponse);
  17. return $jsonResponse['Email'];
  18. }
  19. public function processResponse($apiResponse)
  20. {
  21. list($headers, $content) = explode("\r\n\r\n", $apiResponse, 2);
  22. $jsonResponse = json_decode($content, true);
  23. return $jsonResponse;
  24. }
  25. }
Arguments
  1. "Undefined index: Email"
    


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",
"redirect_uri" => "https://mysistem.com/redirect",
"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