验证Webhook的云功能域

时间:2019-03-28 15:20:24

标签: firebase google-cloud-functions google-calendar-api

如何为google calendar api设置一个Webhook?

我目前正在向api发布信息,说明webhook /地址https://us-central1-pushmessage-bd1eb.cloudfunctions.net/getUsers

axios({
    method: "POST",
    url:
        "https://www.googleapis.com/calendar/v3/calendars/xxx/events/watch",
    headers: {
        "Access-Control-Allow-Origin": "*",
        "Content-Type": "application/json;charset=UTF-8",
        Authorization: token.token_type + " " + token.access_token,
        "Content-Type": "application/json"
    },
    data: {
        id: "tester",
        type: "web_hook",
        address: "https://xxx.cloudfunctions.net/getUsers"
    }
})

但是,我得到了错误:

  code: 401,
  message: 'Unauthorized WebHook callback channel: https://us-central1-xxx.cloudfunctions.net/getUsers' }

如何验证我的云功能的域?

我已经尝试过这种方法,但仍然得到401:

How to perform domain verification for Firebase functions

0 个答案:

没有答案