无法订阅Google云端硬盘推送通知

时间:2020-10-28 22:59:59

标签: google-drive-api

基于: https://developers.google.com/drive/api/v3/push

我不知道从何处获得auth_token_for_current_user

我有服务帐户凭据,也是OAuth令牌。我已经尝试过access_tokenrefresh_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"
 }
}

感谢您的帮助。

0 个答案:

没有答案