Estoy haciendo uso de los eventos del calendario que proporciona Google Calendar API. Al momento de insertar un evento y hacer una consulta rápida a una propiedad en especifico del objeto Event (hangoutLink) me devuelve nulo. Me gustaría saber que es lo que lo provoca.
Anexo el código en donde se hace la inserción.
$this->calendarId="primary";
$event = new Event();
if(isset($Json_Event->free_busy)){
$event->setTransparency($Json_Event->free_busy);
}
$event->setSummary(html_entity_decode($Json_Event->TituloEvento));
if(isset($Json_Event->Lugar))
$event->setLocation(html_entity_decode($Json_Event->Lugar));
if(isset($Json_Event->TipoEvento)){
$event->setVisibility($Json_Event->TipoEvento);
}
$event->setDescription(html_entity_decode($Json_Event->Descripcion));
$event->setCreator($creator);
$event->setOrganizer($organizer);
$event->setStart($start);
$event->setEnd($end);
$event->setAttendees($attendees);
$event->setAttachment($attachments);
$event->setSupportsAttachments($supportAttach);
if(isset($Json_Event->Repetir)){
$recurrence = array($Json_Event->Repetir);
$event->setRecurrence($recurrence);
}
if(isset($Json_Event->ColorId)){
$color = $Json_Event->ColorId;
$event->setColorId($color);
}
// var_dump($event->ReturnArray());
// return false;
$event_calendar = new Google_Service_Calendar_Event($event->ReturnArray());
//$event_optional = array("sendNotifications" => true , "supportsAttachments" => $supportAttach);
$event_optional = array("sendNotifications" => false , "supportsAttachments" => $supportAttach);
$this->oEventCreate = $this->service->events->insert($this->calendarId, $event_calendar,$event_optional);
var_dump($this->oEventCreate->hangoutLink);
Y aquí muestro el resultado de la ejecución:
Google_Service_Calendar_Event Object
(
[collection_key:protected] => recurrence
[internal_gapi_mappings:protected] => Array
(
)
[anyoneCanAddSelf] =>
[attachmentsType:protected] => Google_Service_Calendar_EventAttachment
[attachmentsDataType:protected] => array
[attendeesType:protected] => Google_Service_Calendar_EventAttendee
[attendeesDataType:protected] => array
[attendeesOmitted] =>
[colorId] =>
[created] => 2020-09-02T23:14:06.000Z
[creatorType:protected] => Google_Service_Calendar_EventCreator
[creatorDataType:protected] =>
[description] => Hola mundo
[endType:protected] => Google_Service_Calendar_EventDateTime
[endDataType:protected] =>
[endTimeUnspecified] =>
[etag] => "3198176892442000"
[extendedPropertiesType:protected] => Google_Service_Calendar_EventExtendedProperties
[extendedPropertiesDataType:protected] =>
[gadgetType:protected] => Google_Service_Calendar_EventGadget
[gadgetDataType:protected] =>
[guestsCanInviteOthers] =>
[guestsCanModify] =>
[guestsCanSeeOtherGuests] =>
[hangoutLink] =>
[htmlLink] => https://www.google.com/calendar/event?eid=ajBsOHVvbmQxMWg2NThsanVwNGFmbTU2MDAgY2FwaXRhbHNlZ3Vyb3M5MDZAbQ
[iCalUID] => j0l8uond11h658ljup4afm5600@google.com
[id] => j0l8uond11h658ljup4afm5600
[kind] => calendar#event
[location] => Merida
[locked] =>
[organizerType:protected] => Google_Service_Calendar_EventOrganizer
[organizerDataType:protected] =>
[originalStartTimeType:protected] => Google_Service_Calendar_EventDateTime
[originalStartTimeDataType:protected] =>
[privateCopy] =>
[recurrence] =>
[recurringEventId] =>
[remindersType:protected] => Google_Service_Calendar_EventReminders
[remindersDataType:protected] =>
[sequence] => 0
[sourceType:protected] => Google_Service_Calendar_EventSource
[sourceDataType:protected] =>
[startType:protected] => Google_Service_Calendar_EventDateTime
[startDataType:protected] =>
[status] => confirmed
[summary] => Hola
[transparency] => transparent
[updated] => 2020-09-02T23:14:06.308Z
[visibility] => public
[modelData:protected] => Array
(
[creator] => Array
(
[email] => correo@correo.com
[self] => 1
)
[organizer] => Array
(
[email] => correo@correo.com
[self] => 1
)
[start] => Array
(
[dateTime] => 2020-09-03T14:30:00Z
[timeZone] => America/Mexico_City
)
[end] => Array
(
[dateTime] => 2020-09-03T15:00:00Z
[timeZone] => America/Mexico_City
)
[attendees] => Array
(
[0] => Array
(
[email] => sistemas@correo.com
[responseStatus] => accepted
)
[1] => Array
(
[email] => prueba2@correo.com
[responseStatus] => needsAction
)
)
[reminders] => Array
(
[useDefault] =>
[overrides] => Array
(
[0] => Array
(
[method] => popup
[minutes] => 10
)
[1] => Array
(
[method] => email
[minutes] => 1440
)
)
)
[attachments] => Array
(
[0] => Array
(
[fileUrl] => https://drive.google.com/file/d/14orh8Z-45XHKk9gOapnF48F393eurSN0/view?usp=drivesdk
[title] => aqui.PNG
[mimeType] => image/png
[iconLink] => https://drive-thirdparty.googleusercontent.com/16/type/image/png
[fileId] => 14orh8Z-45XHKk9gOapnF48F393eurSN0
)
)
)
[processed:protected] => Array
(
)
)
Como podrán observar la propiedad [hangoutLink] =>
se envía como vació y leyendo la documentación de Google Calendar API este se genera automáticamente.
Espero puedan apoyarme ya que hago uso del meet de google para videoconferencias.