PHP Google 삽입 캘린더 이벤트 API

Sep 01 2020

이 패키지를 사용하고 있습니다. https://github.com/googleapis/google-api-php-client

$google_service = new Google_Service_Calendar($google_client);
$event = new Google_Service_Calendar_Event(array(....)); // Insert Calendar event $event = $google_service->events->insert($calendarId, $event); p($event);
$meet_link = $event->conferenceData->entryPoints[0]->uri;

나는 가져 오는 데 사용 $meet_link은 API에서 다음과 같이 갑자기 그것은 오류를 던지기 시작

trying to get property 'entryPoints' of non-object"

Infact 캘린더 이벤트가 완벽하게 삽입되었지만 $event->conferenceData->entryPoints[0]->uri응답이 없습니다 . 사실 나는이 entryPoints를 얻지 못하고 있습니다.object($event->conferenceData->entryPoints)

답변

1 Jescanellas Sep 01 2020 at 17:08

API로 이벤트를 생성 할 때 반환되는 ConferenceData에 문제 가있는 것 같습니다 .

문제 번호 옆에있는 별표를 클릭하여 업데이트를 받고 보고서에 더 많은 우선 순위를 부여 할 수 있습니다.

RonakDattani Sep 04 2020 at 13:07

마침내 해결책을 찾았습니다. 요청 부분을 변경해야합니다.

PHP API의 경우

요청에 컨퍼런스 데이터를 전달했습니다.

"conferenceData" => [
        "createRequest" => [
          "conferenceSolutionKey" => [
          "type" => "hangoutsMeet"
        ],
       "requestId" => "123"
    ]
],

$google_service->events->insert($calendarId, $event,['conferenceDataVersion' => 1]);    

세 번째 매개 변수를 설정으로 전달했습니다. [ 'conferenceDataVersion'=> 1] 그런 다음 돌아 오는 회의 링크가 작동하도록합니다.