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

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

Hi Zoho Team,

I'm trying to use the SDK for PHP because I'm transfering API from v1 to v2.
I generated the self-authorized grant token and Access Token from refresh token. However, when I try to test the connection and get some data from my CRM account I get the error:

PHP Fatal error:  Uncaught zcrmsdk\oauth\exception\ZohoOAuthException Caused by:'No Tokens exist for the given user-identifier,Please generate and try again.' in /var/www/html/BARsnp/lib2/vendor/zohocrm/php-sdk/src/oauth/persistence/ZohoOAuthPersistenceByFile.php(46)

My script looks like this:

  1. $configuration = [
    'client_id' => '{ ... }',
    'client_secret' => '{ ... }',
    'redirect_uri' => '{ ... }',
    'currentUserEmail' => '{ ... }',
    'token_persistence_path' => __DIR__
    ];

    $id = '{ ... }';

    ZCRMRestClient::initialize($configuration);
    $contacts = ZCRMRestClient::getModuleInstance('Contacts');
    $response = $contacts->getRecord($id); // To get module records
    $record = $response->getData(); // To get response data
Could you please provide help in order to solve this issue?
Thanks