Hi Paul, Thanks a lot for pointing out the url was wrong. That was the problem.
Appreciate your help -Brad. On Jun 29, 7:00 am, "Paul (Google)" <[email protected]> wrote: > Hi Brad, > > I'm not too sure why you're seeing the redirect, but it looks like you > might not have the proper URL for upgrading to a session token. The > correct URL should be "https://www.google.com/accounts/ > AuthSubSessionToken". It looks like the other headers are correct. > > If you haven't already run across them, the following are a couple of > resources that you might helpful: > > http://code.google.com/apis/health/docs/2.0/developers_guide_protocol...http://code.google.com/apis/accounts/docs/AuthSub.html#AuthSubSession... > > Cheers! > > Paul > > On Jun 28, 5:52 am, Brad <[email protected]> wrote: > > > > > Hi, > > > I am trying to access H9 sandbox from my > > web-sitehttps://healthforce-developer-edition.na7.force.com > > > I am able to get the one-time use token but if I try to > > get a session token I get the following redirect code (302) > > in my response. > > > <HEAD> > > <TITLE>Moved Temporarily</TITLE> > > </HEAD> > > <BODY BGCOLOR="#FFFFFF" TEXT="#000000"> > > <H1>Moved Temporarily</H1> > > The document has moved <A HREF="https://www.google.com/accounts/ > > ServiceLogin?service=weaver&nui=1&continue=https%3A%2F > > %2Fh9.google.com%2Fh9%2Fauthsub&followup=https%3A%2F > > %2Fh9.google.com%2Fh9%2Fauthsub&rm=hide">here</A>. > > </BODY> > > </HTML> > > > Here are my request headers > > > req.setEndpoint('https://h9.google.com/h9/authsub'); > > req.setHeader('GData-Version', '2');//adding/removing makes no > > difference > > req.setMethod('GET'); > > req.setHeader('X-If-No-Redirect', '1' ); > > req.setHeader('content-type', 'application/x-www-form- > > urlencoded' ); > > req.setHeader('Authorization','AuthSub token="' + requestToken+'"');// > > request token is obtained dynamically > > req.setHeader('Accept-Encoding','compress, gzip');//adding/removing > > makes no difference > > > Another thing I noticed is that if I check the Link Status in Google > > Health->Settings > > my website is not listed there. > > > The implementation is done in Apex (Salesforce.com API language) which > > is 90% similar to java. > > > I have spent around 2 days trying to get this to work but in vain. > > Any help would be greatly appreciated. > > > Thank you- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Google Health Developers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/googlehealthdevelopers?hl=en.
