Google日历API:事件:观看-频道ID必须与[A-Za-z0-9 \\ -__ \\ + / =] +匹配

时间:2019-03-29 18:07:41

标签: javascript gapi

我已经看过了这个例子,并使其正常工作:

https://developers.google.com/calendar/quickstart/js

我现在要注意事件的变化:

https://developers.google.com/calendar/v3/reference/events/watch

用户单击按钮后,我正在调用以下代码:

gcloud spanner databases execute-sql {DATABAES_NAME} --instance={INSTANCE_NAME} --sql="SELECT * FROM INFORMATION_SCHEMA.INDEXES

然后我得到以下错误:

gapi.client.calendar.events.watch({
      calendarId: 'primary',
      resource: {
        id: '1234',
        type: 'web_hook',
        address: window.location.href,
      },
    })

我相信{ "error": { "errors": [ { "domain": "push", "reason": "channelIdInvalid", "message": "Channel id must match [A-Za-z0-9\\-_\\+/=]+" } ], "code": 400, "message": "Channel id must match [A-Za-z0-9\\-_\\+/=]+" } } 代表频道ID,我将其设置为resource.id。我真的不明白这是什么或应该是什么。这些文档非常稀疏:/

任何帮助将不胜感激。

谢谢!

1 个答案:

答案 0 :(得分:0)

根据您发布的docs,应该是这样的

gapi.client.calendar.events.watch({
  id: 'primary',
  token: '1234',
  type: 'web_hook',
  address: window.location.href,
})
相关问题