简体   繁体   中英

PHP Google insert calendar event API

I am using this package: 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;

I used to get $meet_link like this from the API but suddenly it started throwing error

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

Infact calendar event has been inserted perfectly but I am not getting $event->conferenceData->entryPoints[0]->uri in response. Infact I am not getting this entryPoints object($event->conferenceData->entryPoints)

There seems to be an issue with the conferenceData returned when creating an event with the API.

You can click on the star next to the issue number to receive updates and to give more priority to the report.

Finally found the solution. Request part needs to change.

For the PHP API

I passed conference Data in request

$event = [ 
    .......,
    "conferenceData" => [
            "createRequest" => [
                 "conferenceSolutionKey" => [
                    "type" => "hangoutsMeet"
                 ],
                "requestId" => "123"
            ]
    ]
];
$google_service->events->insert($calendarId, $event,['conferenceDataVersion' => 1]);    

and passed 3rd parameter as settings ['conferenceDataVersion' => 1] Then its returning meeting link so its working now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM