google-api gem中的“Missing Access Token”

时间:2011-06-17 22:57:00

标签: oauth google-api google-api-client google-prediction

我正在尝试使用google-api gem这样的命令和预测API。我想我一直在这样做,就像我一直在阅读,但它一直给我错误“Missing Access Token”。

首先我通过oauth1进行身份验证。它将我带到登录页面,我登录并授予访问权限。登录后,它会关闭,并在~/.google-api.yaml中创建一个文件,其中包含token_credential_secrettoken_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"

我一直在网上搜索这个答案,但没有太多运气。谷歌的文档通常不是最新的也无济于事。

1 个答案:

答案 0 :(得分:3)

我删除了过时的文档。如果您发现其他任何已过时的信息,请与我们联系。主要问题很简单,我一直是构建Ruby客户端的人,现在我正在转移到肯尼亚,接管它的人仍然在增加。请耐心等待。

请改为:

bin/google-api oauth-2-login \
  --scope=https://www.googleapis.com/auth/prediction \
  --client-id=<your-client-id> \
  --client-secret=<your-client-secret>

然后你可以进行API调用:

google-api execute prediction.training.insert -- data=bucket/train.csv