Grahf
Grahf

Reputation: 171

Google Latitude API and OAuth

Using the below URL to get the current location of a user (myself) I can only use "city" in the granularity parameter and not "best". When I use "best" I get a 401 error, basically stating "Invalid Credentials".

https://www.googleapis.com/latitude/v1/currentLocation?key=<my key>&granularity=<best or city>


Some additional info:
I have already gone through the OAuth dance and obtained an Access Token. My signature method is "HMAC-SHA1" and I am using a "Consumer Key" and "Consumer Secret". My domain for which my code (web app) is running from is registered with Google.

Any information regarding why I get this error or if you have a better way to get the current location of a user, it would be much appreciated.

Upvotes: 0

Views: 1101

Answers (1)

Grahf
Grahf

Reputation: 171

I solved my own problem:

I had to ask for access to the "best" granularity in the OAuth process to use it in any calls to Google's Latitude API. Here is the OAuthAuthorizeToken endpoint I used for anyone interested.


https://www.google.com/latitude/apps/OAuthAuthorizeToken?domain=<my domain>location=current&granularity=best&oauth_token=<oauth token>

Upvotes: 2

Related Questions