What is “authTokenType” parameter in Google data API?

送分小仙女□ 提交于 2019-11-29 15:56:30

问题


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.

In the samples,

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

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

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


回答1:


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

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 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



回答2:


Not entirely relevant, but for others with authTokenType issues, there's a table of authTokenType values here:

http://code.google.com/apis/gdata/faq.html#clientlogin

I used this to figure out that I needed to set authTokenType ="writely" to access the Google Docs List API.




回答3:


Here is detail list for google authTokenType

"ah" "Google App Engine"

"analytics" "analytics" Google Analytics Data APIs

"android" "Android services"

"androiddeveloper" "androiddeveloper"

"annotateweb" "annotateweb" Sidewiki Data API

"apps" "apps" Google Apps APIs (Domain Information & Management)

"blogger" "Blogger" Blogger Data API

"bookmarks" "bookmarks"

"chromiumsync" "chromiumsync"

"cl" "Google Calendar" Calendar Data API

"code" "code"

"codesearch" (does not work) Google Code Search Data API

"cp" "contacts data in Google accounts" Contacts Data API

"datasummary" "datasummary"

"finance" "Google Finance" Finance Data API

"groups2" "Google Groups"

"health" "Google Health" Health Data API

"hist" "hist"

"ig" "iGoogle accounts"

"jotspot" "JotSpot" Google Sites Data API

"lh2" "Picasa Web Albums" Picasa Web Albums Data API

"local" "Google Maps" Maps Data APIs

"mail" "Google mail" Gmail Atom feed

"mobile" "Google mobile apps"

"print" "Google Book Search" Book Search Data API

"reader" "Google Reader"

"sierra" "Google Checkout accounts"

"sitemaps" "Google Webmaster Tools" Webmaster Tools API

"structuredcontent" "structuredcontent"

"talk" "Google Talk"

"weaver" "weaver" H9 sandbox

"wise" "Google Spreadsheets" Spreadsheets Data API

"writely" "Google Docs" Documents List Data API

"youtube" "YouTube"

"Know who you are on Google" "Know who you are on Google" Google+ name of user (does not provide email address)

"Manage your tasks" "Manage your tasks" read-write access to Google Tasks

"View your tasks" "View your tasks" read-only access to Google Tasks

"oauth2:https://www.googleapis.com/auth/userinfo.email" "View your email address" read-only access to the user's email address

"oauth2:https://www.googleapis.com/auth/userinfo.profile" "View basic information about your account" read-only access to basic profile information, including a user identifier, name, profile photo, profile URL, country, language, timezone, and birthdate



来源:https://stackoverflow.com/questions/4773804/what-is-authtokentype-parameter-in-google-data-api

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