基于: 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"
}
}
感谢您的帮助。