4 messages in com.googlegroups.google-calendar-help-dataapiproblem getting session token
FromSent OnAttachments
WHDeveloper21 Mar 2008 06:28 
WHDeveloper21 Mar 2008 07:33 
WHDeveloper21 Mar 2008 07:40 
Austin (Google)21 Mar 2008 09:25 
Subject:problem getting session token
From:WHDeveloper (whip@gmail.com)
Date:03/21/2008 06:28:31 AM
List:com.googlegroups.google-calendar-help-dataapi

I'm new to the GData API and am having an issue exchanging my one time token for a session token. This is the code I have, written in C# :

Service gService; GAuthSubRequestFactory authFactory; String oneTimeToken = Request.QueryString["token"]; String sessionToken;

Response.Write("OTT = " + oneTimeToken + "<br />"); authFactory = new GAuthSubRequestFactory("cp", "Test App"); sessionToken = AuthSubUtil.exchangeForSessionToken(oneTimeToken, null); authFactory.Token = sessionToken; gService = new Service("cp", authFactory.ApplicationName); gService.RequestFactory = authFactory;

Specifically, I'm trying to access contact data, but I figure this question is general enough to apply anywhere.

I can't figure what I'm doing wrong. I get a oneTimeToken, for certain, but when I call exchangeForSessionToken it returns null. If I need to clarify with more code or anything, I certainly can.

Thanks!