I have read a lot of articles :
Google Calendar API - PHP https://developers.google.com/calendar/quickstart/php
and others.. I want to use the service account, I gave permissions for my calendar, I have downloaded the json key. If I use the code from Google, I got:
missing the required redirect URI
If i use the code:
$client = new Google\Client();
$client->setApplicationName('Gcal');
$client->setAuthConfig($key_file_location);
$client->setScopes([Google_Service_Calendar::CALENDAR]);
$client->setSubject($calendarId);
$client->setAccessType('offline');
$service = new Google_Service_Calendar($client);
I have:
Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested
I don't have admin.google access, I need to access only my own calendar and delete old events. Please let me know what I am missing.
thank you


