Google Calendar API:事件描述和位置无法使用insert方法

时间:2016-04-25 20:37:45

标签: php api calendar google-calendar-api

我的应用程序通过Calendar API创建Google Calendar事件。我能够连接到API并使用PHP以编程方式创建事件。

但是,我似乎无法传递位置和描述值。其他值,例如Summary,ID,Start和End正常工作。

位置和说明只是不会显示在Google日历中。为什么不呢?

这是我的代码:

    $event_data = new Google_Service_Calendar_Event(array(
        'summary'     => html_entity_decode($title),
        'id'          => $event_id,
        'location'    => '123 Fake Street',
        'description' => 'This is the event description.',
        'start'       => array(
            'date'      => $start_date,
            'timeZone'  => 'America/Vancouver'
         ),
        'end'         => array(
            'date'      => $end_date,
            'timeZone'  => 'America/Vancouver'
        )
  ));

  try {

   $event = $calendar_service->events->insert($calendar, $event_data);

  } catch ( Exception $e ) {

    echo '<h1>Oh no!</h1>';
    echo '<p>There was an error connecting with Google Calendar:</p>';
    echo '<pre>';
      echo $e->getMessage();
    echo '</pre>';
    die();
  }

谢谢!

0 个答案:

没有答案
相关问题