How to detect if account is standard or Premier?

123 views
Skip to first unread message

VHanded

unread,
Dec 21, 2010, 4:31:46 AM12/21/10
to Google Documents List API
Hi, I am using Doc List API in .net, and knowing that the debate is
strong regarding upload arbitrary files. So here, I need to know how
we can know the user account type, whether is standard, or Premier, or
Business account, and provide the particular rights for particular
user.


Thanks.

Andrew Fields

unread,
Dec 21, 2010, 4:43:12 AM12/21/10
to google-docum...@googlegroups.com
A big +1 on this.
This would be a very useful feature.
Is there any way of doing it?

Thanks,

hitoshi uchida

unread,
Dec 21, 2010, 4:52:38 AM12/21/10
to Google Documents List API
Hi,

You can identify which data format can be uploaded or not by obtaining
metadata feed like below.
http://code.google.com/intl/ja/apis/documents/docs/3.0/developers_guide_protocol.html#MetaDataFeed

Andrew Fields

unread,
Dec 21, 2010, 4:58:57 AM12/21/10
to google-docum...@googlegroups.com
Hi Hitoshi,

Thanks for your quick reply.  Have you got the metadata feed working?

I've had problems with it:
http://www.google.com/support/forum/p/apps-apis/thread?tid=0de267056ea85e37

-Andrew

VHanded

unread,
Dec 21, 2010, 5:02:18 AM12/21/10
to Google Documents List API
I realize that, but I can't find .net client implementation for that,
and I don't know how to retrieve that feed.

Never had much knowledge on WebRequest, so this is what I tried:

HttpWebRequest request= HttpWebRequest.Create(new Uri("https://
docs.google.com/feeds/metadata/" + service.Credentials.Username + "?
v=3&auth_token=" + service.Credentials.ClientToken)) as
HttpWebRequest;
request.Method = WebRequestMethods.Http.Get;
request.Headers.Add("Authorization: GoogleLogin auth="
+ service.Credentials.ClientToken);

HttpWebResponse response =
metadataRequest.GetResponse() as HttpWebResponse;

It returns unauthorized 401.

Any can help me?

On Dec 21, 5:52 pm, hitoshi uchida <hitoshi.uch...@gmail.com> wrote:
> Hi,
>
> You can identify which data format can be uploaded or not by obtaining
> metadata feed like below.http://code.google.com/intl/ja/apis/documents/docs/3.0/developers_gui...

Andrew Fields

unread,
Dec 21, 2010, 5:13:12 AM12/21/10
to google-docum...@googlegroups.com
Yes, I got a similar error, as did another user.

It would be nice to know if we're doing something stupid or if the metadata feed is broken.

Can Vic, or anyone at Google confirm if it works?

hitoshi uchida

unread,
Dec 21, 2010, 5:20:14 AM12/21/10
to Google Documents List API
Hi,

To Andrew, I haven't tried the API yet. I would do later, sorry.
To VHanded,
first, your request url isn't correct because the format is "https://
docs.google.com/feeds/metadata/<user-id>".
So, I recommend to use "https://docs.google.com/feeds/metadata/
default".
And you should specify the version number into http request header
like "GData-Version : 3.0".
Could you try based on this ?

Regards,
Hitoshi Uchida

hitoshi uchida

unread,
Dec 21, 2010, 5:26:04 AM12/21/10
to Google Documents List API
Hi all,
I tried the API now, I could retrieve the metadata feed correctly.

VHanded

unread,
Dec 21, 2010, 5:27:09 AM12/21/10
to Google Documents List API
Hi Hitoshi,

I tried your suggestion, it's not working. It returns the same error,
and the problem I guess is authentication.
How should I attach my token or whatever string that can authenticate
me?

Thanks.

Andrew Fields

unread,
Dec 21, 2010, 5:32:36 AM12/21/10
to google-docum...@googlegroups.com
Thanks for checking, Hitoshi.

Is there any chance you could post your http get request string?

I get a 400 error with a username and a 401 with default.

Thanks,

Andrew

hitoshi uchida

unread,
Dec 21, 2010, 5:33:15 AM12/21/10
to Google Documents List API
Hi VHanded,

First, you should check that the token is available or not by
requesting other API.
Next, please check below items.
1. authentication
Authorization: GoogleLogin auth=yourAuthValue
2. gdata version number
GData-Version : 3.0
3. request url
https://docs.google.com/feeds/metadata/default

If you add other unnecessary parameter, maybe you would fail.

hitoshi uchida

unread,
Dec 21, 2010, 5:37:01 AM12/21/10
to Google Documents List API
Hi Andrew,

Below is the captured packet of my request.

GET /feeds/metadata/default HTTP/1.1
User-Agent: test/1.0
Host: docs.google.com
Authorization: GoogleLogin auth=mykey
GData-Version: 3.0






On 12月21日, 午後7:33, hitoshi uchida <hitoshi.uch...@gmail.com> wrote:
> Hi VHanded,
>
> First, you should check that the token is available or not by
> requesting other API.
> Next, please check below items.
> 1. authentication
> Authorization: GoogleLogin auth=yourAuthValue
> 2. gdata version number
> GData-Version : 3.0
> 3. request urlhttps://docs.google.com/feeds/metadata/default

Andrew Fields

unread,
Dec 21, 2010, 5:42:43 AM12/21/10
to google-docum...@googlegroups.com
Thank you very much, Hitoshi!

I'll give it a try!

hitoshi uchida

unread,
Dec 21, 2010, 5:44:56 AM12/21/10
to Google Documents List API
Hi Andrew,

Concerning your 400 error with username,
I think the error suggests you that a wrong username was specified.
Do you specify the email like "hitoshi...@gmail.com" ?
I could retrieve the metadata feed using the username now.

Andrew Fields

unread,
Dec 21, 2010, 6:16:43 AM12/21/10
to google-docum...@googlegroups.com
Hi Hitoshi,

Thanks to your advice, and sample, I have it working now. 

Domo arigato gozaimas


Andrew Fields

unread,
Dec 21, 2010, 6:26:44 AM12/21/10
to google-docum...@googlegroups.com
VHanded: I just tried your code too. 

It works for me if I add the GData version to the header and not in "v3" in the request, something like:
request.Headers.Add("GData-Version: 3.0")

Hitoshi Uchida

unread,
Dec 21, 2010, 6:45:02 AM12/21/10
to google-docum...@googlegroups.com
Hi Andrew,

That's good news !

--
Hitoshi Uchida

VHanded

unread,
Dec 21, 2010, 9:29:53 AM12/21/10
to Google Documents List API
Hi, Hitoshi,

In my code, I changed service.Credentials.ClientToken to
service.QueryClientToken() method, and it works now.

Thanks a lot.

On Dec 21, 7:45 pm, Hitoshi Uchida <hitoshi.uch...@gmail.com> wrote:
> Hi Andrew,
>
> That's good news !
>
> --
> Hitoshi Uchida
>

Vic Fryzel

unread,
Dec 21, 2010, 11:54:00 AM12/21/10
to google-docum...@googlegroups.com
Wow, this is a very active thread, sorry for not chiming in sooner.

Hitoshi is 100% correct.  I'm glad everyone got it working.

For others' reference, the metadata feed returns an entry containing this member:
<docs:feature>
  <docs:featureName>upload_any</docs:featureName>
</docs:feature>

Which identifies who can/cannot upload any file type.

Thanks,
-Vic

Javier Martinez

unread,
Jun 3, 2011, 7:05:17 AM6/3/11
to google-docum...@googlegroups.com
I'm having problems getting the account information.
On all the accounts I test, the "upload_any" value is given. ALWAYS. Business and free accounts.
Then I try to upload a file (psd for example) and only business account success.
I can't detect who can/cannot upload any file type.

Someone can help me with this?

Rob Wyrick

unread,
Jun 3, 2011, 7:37:44 AM6/3/11
to google-docum...@googlegroups.com
You must use resumable upload for non business accounts.  Actually, we encourage you to *always* use resumable upload.
-Rob

Andrew Fields (Gmail)

unread,
Jun 3, 2011, 8:29:55 AM6/3/11
to Google Documents List API
Feature request: Adding a field to the metadata feed to indicate what
sort of account the user has, its nice to know for other reasons than
upload abilities.

Vic Fryzel

unread,
Jun 3, 2011, 8:50:01 PM6/3/11
to google-docum...@googlegroups.com
Andrew,

Can you cite the reasons?  If you've compelling enough reasons, it would help us prioritize such a request.

-Vic

Andrew Fields

unread,
Jun 3, 2011, 10:32:46 PM6/3/11
to google-docum...@googlegroups.com
No compelling reasons. It might be useful in helping us debug user problems. But with all account types being equal now, its really just a nice to have. 

Vic Fryzel

unread,
Jun 4, 2011, 12:06:07 AM6/4/11
to google-docum...@googlegroups.com
We've received this request a few times.  There's currently an undocumented way to detect this using OpenID, but that's not really ideal.

Quota is still somewhat of an indicator of the type of account, but it's not a 100% solution here, as technically a non-Google Apps for Business account could have the same quota as a Google Apps for Business account.

I think that, ideally, we'd just expose whatever fields in the metadata feed that you think differ between user accounts now.  That said, I'm unaware of any fields missing from the metadata feed.  If you can find any, let me know.

-Vic

Terence Pua

unread,
Jun 10, 2011, 7:39:28 AM6/10/11
to google-docum...@googlegroups.com
Vic,

Pricing is one helpful reason for this request, especially being able to distinguish between GApps accounts (education vs. business, etc.).

Thanks,
Terence

Vic Fryzel

unread,
Jun 13, 2011, 2:21:48 PM6/13/11
to google-docum...@googlegroups.com
Ah, interesting.  Okay, we'll consider it.

-Vic
Reply all
Reply to author
Forward
0 new messages