March 28, 2010

Queries against Google Ananlytics Data Export API with ClientLogin

Just wanted to share this little bit of info with those of you have yet to find it!

When making queries against the Google Analytics (GA) (and most likely all Google) Data Export APIs when you have authenticated using ClientLogin the authentication type sent as a header in HTTP GET.

I missed that somehow and kept getting "401 Token Invalid - Invalid AuthSub Token" when trying to retrieve the GA account profiles. My error was ofcourse sending
"Authorization: AuthSub token="
which is related to the AuthSub authentication method.

When querying for data you need to send:
"Authorization: AuthSub token="
instead.

No comments: