什么是"authTokenType"? Google数据API中的参数? [英] What is "authTokenType" parameter in Google data API?

查看:213
本文介绍了什么是"authTokenType"? Google数据API中的参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚使用新的google-api-java-client实现了Google Translator Toolkit API.问题是,在文档的任何地方都没有提到authTokenType,这对于身份验证似乎很重要.

I just implemented Google Translator Toolkit API using the new google-api-java-client. Problem is, that authTokenType isn't mentioned anywhere in documentation and it seems to be important for authentication.

在示例中

bigquery-json-clientlogin-sample正在使用authTokenType = "ndev";

bigquery-json-clientlogin-sample is using authTokenType = "ndev";

prediction-json-clientlogin-sample正在使用authTokenType = "xapi";

prediction-json-clientlogin-sample is using authTokenType = "xapi";

如果我使用这两个之一,则会获得授权令牌,但是如果使用它,则将禁止403访问该服务. 如果我使用其他无论如何",我什至都不会获得授权令牌...

if I use one of these two, I get the authorization token, but If I use it, I'm 403 forbidden to access the service. If I use different "whathever" I don't even get the authorization token...

> 此处 是客户端代码

Here is the client code

推荐答案

我在旧的gdata客户端库中发现了这一点.它是" gtrans "

I found that in the old gdata client library. It is "gtrans"

但是,如果您中有人要使用新的google-api-java-client库为google API实现客户端.您必须使用gdataVersion = "1.0";而不是gdataVersion = "2.0";,因为它不起作用,而且您也不知道为什么...

But if anybody of you were gonna implement client for google APIs using the new google-api-java-client library. You have to use gdataVersion = "1.0"; instead of gdataVersion = "2.0"; because it won't work and you don't know why...

authTokenType是服务的类型

authTokenType is type of the service

 gtrans                        Google Translator Toolkit
 analytics                     Google Analytics Data APIs
 apps                          Google Apps APIs
 jotspot                       Google Sites Data API
 blogger                       Blogger Data API
 print                         Book Search Data API
 cl                            Calendar Data API
 codesearch                    Google Code Search Data API
 cp                            Contacts Data API
 structuredcontent             Content API for Shopping
 writely                       Documents List Data API
 finance                       Finance Data API
 mail                          Gmail Atom feed
 health                        Health Data API
 local                         Maps Data APIs
 lh2                           Picasa Web Albums Data API
 annotateweb                   Sidewiki Data API
 wise                          Spreadsheets Data API
 sitemaps                      Webmaster Tools API
 youtube                       YouTube Data API

这篇关于什么是"authTokenType"? Google数据API中的参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆