Google 계정이 있고 캘린더 목록에 3 개의 Google 캘린더가 있습니다. 선택한 Google 캘린더로 일정을 만들려고합니다. 나는 PHP를 사용하고 있습니다.동일한 계정으로 선택된 Google 캘린더에서 일정을 만들 수 있습니다.
here is list of google calendars.
+----------------------+-----------------------------------------------+
| calName | calid |
+----------------------+-----------------------------------------------+
| [email protected] | [email protected] |
| Contacts | #[email protected] |
| Holidays in India | en.indian#[email protected] |
+----------------------+-----------------------------------------------+
[email protected]는 "primary
"달력입니다. 이 캘린더에서 일정을 만들면 PHP를 사용하여 이벤트가 성공적으로 만들어졌습니다.
그러나 "Contacts, Holidays in India
"캘린더에서 이벤트를 만들려고하면이 캘린더에 대해 PHP를 사용하여 이벤트를 생성하지 않습니다.
내 코드 :
$event = new Google_Service_Calendar_Event(array(
'summary' => $eventname,
'location' => $address,
'description' => $description,
'start' => array(
'dateTime' => $s,
'timeZone' => $timezone,
),
'end' => array(
'dateTime' => $e,
'timeZone' => $timezone,
),
'attendees' => array(
array('email' => $contactemail),
),
'reminders' => array(
'useDefault' => FALSE,
'overrides' => array(
array('method' => 'email', 'minutes' => 24 * 60),
array('method' => 'popup', 'minutes' => 10),
),
),
));
$calid = 'en.indian#[email protected]'; // this is static for now
$event = $service->events->insert($calid, $event);
오류 :
Fatal error: Uncaught exception 'Google_Service_Exception' with message 'Error calling POST https://www.googleapis.com/calendar/v3/calendars/en.indian%23holiday%40group.v.calendar.google.com/events : (403) Forbidden' in /var/www/myinvitebig.com/vendor/google/apiclient/src/Google /Http/REST.php:110 Stack trace: #0 /var/www/myinvitebig.com/vendor/google/apiclient/src/Google/Http/REST.php(62): Google_Http_REST::decodeHttpResponse(Object(Google_Http_Request), Object(Google_Client)) #1 [internal function]: Google_Http_REST::doExecute(Object(Google_Client), Object(Google_Http_Request)) #2 /var/www/myinvitebig.com/vendor/google/apiclient/src/Google/Task/Runner.php(174): call_user_func_array(Array, Array) #3 /var/www/myinvitebig.com/vendor/google/apiclient/src/Google/Http/REST.php(46): Google_Task_Runner->run() #4 /var/www/myinvitebig.com/vendor/google/apiclient/src/Google/Client.php(593): Google_Http_REST::execute(Object(Google_Client), Object(Google_Http_Request)) #5 /var/www/myinvitebig.com/vendor/google/apiclient/src/Google/Ser in /var/www/myinvitebig.com/vendor/google/apiclient/src/Google/Http/REST.php on line 110