Google Sheets API Error: invalid_user: Robot is missing a project number

扶醉桌前 提交于 2019-12-23 17:23:19

问题


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.

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.


回答1:


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!




回答2:


I had the same issue and solved it by changing the scope value:

scope = ['https://spreadsheets.google.com/feeds'] to be replaced by scope = ['https://www.googleapis.com/auth/drive']

I hope it helps you...



来源:https://stackoverflow.com/questions/52199170/google-sheets-api-error-invalid-user-robot-is-missing-a-project-number

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!