我正在尝试将 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
我现在应该被认证不是吗?当我尝试执行命令时,它得到Missing Access Token
.
google-api execute prediction.training.insert "data=bucket/train.csv"
我一直在网上搜索这个答案,但运气不佳。谷歌的文档通常不是最新的也无济于事。