google-drive-api - 无法订阅 Google Drive 推送通知
问题描述
基于: https ://developers.google.com/drive/api/v3/push
我不明白从哪里得到auth_token_for_current_user
。
我有服务帐户凭据,还有一个 OAuth 令牌。我试过了access_token
,refresh_token
......我不明白这应该是什么令牌。
curl --location --request POST 'https://www.googleapis.com/drive/v3/changes/watch' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 1//064ToBH1n***' \
--data-raw '{
"id":"***",
"type": "web_hook",
"address": "https://***.cloudfunctions.net/verify"
}'
返回:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "authError",
"message": "Invalid Credentials",
"locationType": "header",
"location": "Authorization"
}
],
"code": 401,
"message": "Invalid Credentials"
}
}
谢谢你的帮助。
解决方案
推荐阅读
- sql - 在 Oracle SQL 中使用 IF 语句
- angular - 展开 mat 侧边栏内容,无需双标
- gdb - GDB 问题:堆栈上的未知值
- python - PYTHON - 如何定义多重继承顺序
- xaml - 将三个属性绑定到 DatePicker
- elasticsearch - 如何连接 Hibernate elasticsearch 使用 SSL 和 quarkus?
- javascript - 找不到模块 vue/ref-transform
- reactjs - 反应视频不自动播放,自动播放不起作用
- constants - Delphi 11:常量对象不能作为 var 参数传递
- list - ScrollViewReader 不以编程方式滚动