Google Sheets API错误:invalid_user:机器人缺少项目编号 [英] Google Sheets API Error: invalid_user: Robot is missing a project number
问题描述
尝试使用在我的项目中创建的服务帐户访问Google表格时,我得到了invalid_user: Robot is missing a project number.
.
我遵循URL中提到的确切步骤:
I am getting invalid_user: Robot is missing a project number.
when trying to access google sheets using the service account created in my project.
I followed the exact steps mention in the URL: https://www.twilio.com/blog/2017/02/an-easy-way-to-read-and-write-to-a-google-spreadsheet-in-python.html
它似乎适用于其他所有人,而且令人惊讶的是,我无法在网络上找到任何解决方案.
It seems to work for everyone else, and surprisingly I am not able to find any solution on the web.
使用oAuth凭据访问数据对我来说很好,但是我想将代码部署到AWS Lambda,因此需要服务器到服务器的访问.
Accessing the data using oAuth credentials is working good for me, but I want to deploy the code to AWS Lambda and hence need server to server access.
推荐答案
问题是我用我的电子邮件ID替换了client_email.相反,我应该使用服务帐户的电子邮件ID共享电子表格!
The problem was me replacing the client_email by my email ID. Rather, I should have shared the spreadsheet with the service account email ID!
这篇关于Google Sheets API错误:invalid_user:机器人缺少项目编号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!