Google+ API WTF

13 Nov 2013

I've been playing with the Google+ APIs for a while now in a number of small, personal...

I've been playing with the Google+ APIs for a while now in a number of small, personal side projects. I have code that can get my list of Google+ posts, for example, and last night I implemented enough of the GData API to get my contacts.

That'd be fine, except that the contacts don't include any clues about what circles they belong to.

<aside>Yo, Google, how about when you publish an API for getting my data you actually, you know, put all of my data in it; I can't get location information for the posts either from the existing APIs even though the information is clearly there somewhere.</aside>

Since circles are effectively the grouping mechanism for contacts, the absence of this information is crippling. I do want to be able to select all my "Friends" contacts and all my "MarkLogician" contacts, etc.

A little digging reveals that there is an API for getting a list of your circles and from there a list of the people you have in them. Ok. Kind of tedious that I have to do it in two steps, but hey, it's just bits.

Except it doesn't work. The request

      request = circle_service.list(userId='me')

fails with a 403. It appears that this API is only available to Google Apps users or something which apparently doesn't include my own data in my personal account.


#GoogleAPI #post #WTF

This page was generated automatically from a post on Google+.


FWIW, I get why there's got to be some level of, for lack of a better word, security, around circle membership.

I don't want to know you that you have me in your "Stupid XML Lusers" circle any more than I want you to know I have you in my "Clueless twits" circle.

But there's no reason not to tell me who I have in my circles, surely!

(I know, don't call you Shirley. Funny.)

—Posted by Norman Walsh on 13 Nov 2013 @ 11:24 UTC #

The non-obvious thing here is that circles and contacts aren't the same list - you can have contacts not in your circles and vice versa - so they are separate APIs for separate data sources. Following this, the contact scope doesn't grant access to circles. You need to request the Google+ login scope (e.g in JS).

That will work for any account. The GData contacts API is rather old (the fact it still uses GData speaks to that if nothing else). Hopefully we'll get to a better solution for both in the future!

—Posted by Ian on 15 Nov 2013 @ 10:35 UTC #

Ah, reading the accompanying G+ discussion I see you were trying to get the individual circles, which there isn't an API for - you can get the flat list of people, but not the individuals/circle mappings.

Re that security thing, the way OAuth 2.0 works means that we are delegating access to your data to an app - that app may also in fact be you, but we don't have any different filtering for that level of access vs you granting access to some third party. Ade mentioned takeout in the thread, which is the user-method for accessing data - because the group of people who are both developers and user is naturally small, any API released will be consumed vastly by apps who are distinct parties to the user's whose data they are accessing.

—Posted by Ian on 15 Nov 2013 @ 10:43 UTC #