【问题标题】:Get the status of calendar in Google calendar through api通过api获取谷歌日历中日历的状态
【发布时间】:2018-01-05 11:10:10
【问题描述】:

我曾经通过以下 API 调用使用日历 ID 获取日历名称:

https://www.googleapis.com/calendar/v3/calendars/877rak5vqdsj68q52tehukeopg@group.calendar.google.com

然后我收到类似

的响应
{
 """"kind"""": """"calendar#calendar"""",
 """"etag"""": """"\""""ULsH1YPfrSsaWJsYynxh4efocZw/z3mgue7ZR46jHMp-7DrpcXUmmDY\"""""""",
 """"id"""": """"877rak5vqdsj68q52tehukeopg@group.calendar.google.com"""",
 """"summary"""": """"HELLO"""",
 """"description"""": """"HELLO"""",
 """"timeZone"""": """"UTC"""",
 """"conferenceProperties"""": {
 """"allowedConferenceSolutionTypes"""": [
 """"eventHangout""""
   ]
  }
}

现在我如何通过 Google Calendar API 知道这个日历的状态,无论它是否被删除。请帮帮我。

【问题讨论】:

    标签: google-calendar-api google-console-developer


    【解决方案1】:

    如果您要检查CalendarList,日历资源有一个属性已删除,如果它被删除,它可以有一个布尔值。

    {
      "kind": "calendar#calendarListEntry",
      "etag": etag,
      "id": string,
      "summary": string,
      "description": string,
      "location": string,
      "timeZone": string,
      "summaryOverride": string,
      "colorId": string,
      "backgroundColor": string,
      "foregroundColor": string,
      "hidden": boolean,
      "selected": boolean,
      "accessRole": string,
      "defaultReminders": [
        {
          "method": string,
          "minutes": integer
        }
      ],
      "notificationSettings": {
        "notifications": [
          {
            "type": string,
            "method": string
          }
        ]
      },
      "primary": boolean,
      "deleted": boolean,
      "conferenceProperties": {
        "allowedConferenceSolutionTypes": [
          string
        ]
      }
    }
    

    希望这会有所帮助。

    【讨论】:

    • 我看到需要为此传递“showDeleted”参数。那么既然 calendarList api 是一个 GET 连接,我该如何传递这个参数呢?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-15
    • 1970-01-01
    • 2020-11-04
    • 2016-01-03
    • 2017-08-30
    • 1970-01-01
    相关资源
    最近更新 更多