请求缺少必需的身份验证凭据.预期的OAuth 2访问令牌,登录cookie或其他有效的身份验证凭据 [英] Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential

查看:1146
本文介绍了请求缺少必需的身份验证凭据.预期的OAuth 2访问令牌,登录cookie或其他有效的身份验证凭据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试更新Google工作表值.

I am trying to update Google sheet values.

请求具有无效的身份验证凭据.预期的OAuth 2访问令牌,登录cookie或其他有效的身份验证凭据."

"Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential."

我想使用API​​密钥而不是2.0来做到这一点

I want to do this using API key not outh 2.0

任何人都有什么建议.

推荐答案

不可能.您需要使用电子表格中此处指示的OAuth登录信息. values.batchUpdate :

您可以在授权部分看到它使用OAuth范围,因此得出的结论是它使用了OAuth而不是API KEY:

You can see on the authorization part that it uses OAuth scopes, therefore it follows that it uses OAuth not API KEY:

授权

需要以下OAuth范围之一:

Requires one of the following OAuth scopes:

https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/spreadsheets

这篇关于请求缺少必需的身份验证凭据.预期的OAuth 2访问令牌,登录cookie或其他有效的身份验证凭据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆