1

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

답변

1

'en.indian#[email protected]'

2014 구글 캘린더에 출시 된 많은 휴일 달력 중 하나입니다. 이들은 누구나 구독 할 수있는 Google 캘린더의 공개 캘린더입니다. 그러나 당신이 말한 달력에 가입했기 때문에 당신이 그 달력에 대한 쓰기 권한을 가지고 있다는 것을 의미하지는 않습니다. 휴일 캘린더의 경우 읽기 전용 액세스 권한이 있습니다.

(403) Forbidden

당신이하고자하는 일을 할 수있는 권한이 없다는 의미입니다. 이 경우 사용자가 직접 쓸 수있는 권한이없는 달력에 이벤트를 추가하십시오.