“缺少访问令牌”在 google-api gem 中
我正在尝试将 google-api gem 等命令与预测 API 一起使用。我想我一直在按照我读过的方式做这件事,但它一直给我错误“缺少访问令牌”。
首先我通过 oauth1 进行身份验证。它带我进入登录页面,我可以在其中登录并授予访问权限。登录后,它会关闭,并在 ~/.google-api.yaml
中创建一个包含 token_credential_secret
和 token_credential_key
的文件。
google-api oauth-1-login --scope https://www.googleapis.com/auth/prediction
我现在应该已经通过身份验证了不是吗?当我尝试执行命令时,它得到缺少访问令牌
。
google-api execute prediction.training.insert "data=bucket/train.csv"
我一直在互联网上寻找这个答案,但运气不佳。谷歌的文档通常不是最新的,这也无济于事。
I'm trying to use the command like google-api gem with the prediction API. I think I've been doing this exactly as I've been reading, but it keeps giving me the error "Missing Access Token".
First I authenticate via oauth1. It brings me to the log in page where I log in and grant access. After I log in, it closes and there is a file created in ~/.google-api.yaml
with a token_credential_secret
and token_credential_key
.
google-api oauth-1-login --scope https://www.googleapis.com/auth/prediction
I should be authenticated now aren't I? When I try to execute a command, it get Missing Access Token
.
google-api execute prediction.training.insert "data=bucket/train.csv"
I've been scouring the internet for this answer, but without much luck. It also doesn't help that google's docs usually aren't up to date.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我删除了过时的文档。如果您发现任何其他过时的内容,请告诉我。主要问题很简单,我一直是构建 Ruby 客户端的人,现在我要搬到肯尼亚,而接管它的人仍在增加。请耐心等待。
这样做:
然后您可以进行 API 调用:
I removed the docs that were out-of-date. Let me know if you see anything else that's out-of-date. Main issue is simply that I've been the person building the Ruby client and now I'm moving to Kenya, and the people who are taking it over are still ramping up. Please bear with us.
Do this instead:
Then you can make your API calls: