googleapis / google-api-php-client

A PHP client library for accessing Google APIs
http://googleapis.github.io/google-api-php-client/
Apache License 2.0
9.31k stars 3.52k forks source link

Google Calendar Event - entryPoints #2597

Closed A35G closed 2 months ago

A35G commented 4 months ago

Hi, via the API I am able to generate a new event on Calendar (with Google Meet included) but if I try to set a password, pin, passcode, etc.. they return in the JSON of the event, always empty.

Has anyone been able via the API, to set them?

The same happens with the 'notes' field.

Example:

        'conferenceData' => [
            'createRequest' => [
                'requestId' => 'aaaaaaaa',
                'conferenceSolutionKey' => [
                    'type' => 'hangoutsMeet'
                ]
            ],
            'entryPoints'   =>  [[
                'entryPointType' => 'video',
                'pin' => '123456',
                'passcode' => '123456',
                'password' => '123456'
            ]],
            'notes' => 'Lorem Ipsum Dolor'
        ],
Hectorhammett commented 3 months ago

Hello @A35G

Do you have a code example to take a look at? :)

Hectorhammett commented 2 months ago

Closing this due inactivity. Feel free to comment back. If you have a code example the better!

A35G commented 2 months ago

Hi @Hectorhammett, please forgive the delay in responding.

Below is a portion of code used as an example:

require __DIR__ . '/../vendor/autoload.php';

use function GuzzleHttp\Promise\all;

$authCode = "";

$client = manageClient($authCode);

$srvc = new Google\Service\Drive($client);
$service = new Google\Service\Calendar($client);

$calendarId = 'primary';
$newmeet = new Google\Service\Calendar\Event(array(
    'summary' => 'A simple Test',
    'location' => 'Lorem Ipsum Dolor',
    'description' => 'It\' a simple test with Meet event',
    'colorId'   =>  '4',
    'attachments' => array(),
    'start' => array(
        'dateTime' => '2024-05-27T13:45:00+02:00',
        'timeZone' => 'Europe/Rome',
    ),
    'end' => array(
        'dateTime' => '2024-05-27T13:50:00+02:00',
        'timeZone' => 'Europe/Rome',
    ),
    'recurrence' => array(
        'RRULE:FREQ=DAILY;COUNT=1'
    ),
    'attendees' => array(
        array(
            'displayName'   =>  'Mario Rossi',
            'email'         =>  'm.rossi@gmail.tld'
        )
    ),
    'conferenceData' => [
        'createRequest' => [
            'requestId' => 'zazazaza1',
            'conferenceSolutionKey' => [
                'type' => 'hangoutsMeet'
            ]
        ],
        'entryPoints'   =>  [[
            'entryPointType' => 'video',
            'pin' => '123456',
            'passcode' => '123456',
            'password' => '123456'
        ]],
        'notes' => 'Lorem Ipsum Dolor'
    ],
    'reminders' => array(
        'useDefault' => false,
        'overrides' => array(
            array(
                'method'    =>  'email',
                'minutes'   =>  24 * 60
            ),
            array(
                'method'    =>  'popup',
                'minutes'   =>  10
            )
        )
    )
));

$service->events->insert($calendarId, $newmeet,array(
    'conferenceDataVersion' =>  1,
    'sendUpdates'           =>  'all',
    'supportsAttachments'   =>  true
));

I hope it will fit as an example.