Hi Shrenik,
You may want to try the following:
BasicHeader basicHeader = new BasicHeader("Authorization","GoogleLogin
auth=" + hashMap.get("Auth"));
This would use "auth=" in the parameter instead of "Auth=", and also
remove the quotes around the token; the quotes are used for AuthSub,
not ClientLogin (my confusion).
Let us know how it goes!
Paul (Google)
On May 19, 11:49 pm, Shrenik Vikam <[email protected]> wrote:
> I am getting followinf error .....
> Oops an error has occured.
> Please include the following information in your error report:
>
> AP52v_T_I_zy1WzNtX5qWQo7Um1_a4CRiMETTt89_TTH34qeoytic_WUz3CUvGPwhNdQfb1G4e8
> KLd9W
> nOX5qrIo1jcj_Z-7O6wCKpJ3r8LnWKnJ=================KXKgoNkiTPkA2MSLAQTJ63vVXL
> VQiKP
> xUl2tGPJz95-
> ZhQaUFmdbzL===================================8RqdcYDCrvSrgR516LJZzs
> t_OUjwXQPgC5K15Xorhe==========================================Vlh371voi4DrZ
> z_obD
> 15RPBn60dPV7IEbSj=============N1-O7-
> CyPGag9lF3myeJg==============UJ1bRKnZp5i9gSl
> b2kzCUIrjB9Mm6===========LUY_Fb62ormNYz7OEQimWkqOmgaMlsd============aYrpwwe
> Nag_D
> KVOHLyyD3Vi===========jr3Acsn-CAMvxD4geo9LSyl9-
> RcMY76g3Womj===========KwzlluNuP1
> fjK7puepg==========X7FSPVPYwh6pb5nZnc_oN0d65wyJuYZkNeornWXwnb8=========X6vX
> dFvb4
> JCqDlF3==========OkgwPe======WqBF2DX-
> eZYqNix7cqceorE======3Tn5zG=========XW7c6Z7
> ieC1il=========nWKn2Iit==rY==Y3fidhGQNEYdQy29vpP-RDp==zB==UZoEh3Z-
> ========RLdVYN
> JJ68-========x6X_WTM2QL======PWLE2BUf43y27D1quiQergj======6oAX-
> TiewN=======m94Xd
> gm-Wh======Jc4bI7AACoA144Vh4gR-
> kDizSLjYlvMfFZulVxHPzLd9yD7yy122GhG4Ei======iPtU7
> c-
> oP======CYuGNJ8O3e1EpOOsA8NyAnbfhsJJLZS98kK1AXIfoRWZZbuUKwnb7BJvRGKC======0
> 1Ma
> o-os======ZM6NyjjueGbKdLSIjzewudhINoKwLHs0JXAUqVYEKrjXSV-u3r-
> UbgHtQoDP======zT1G
> eI2======xxxXLN539N31jREZEbf96yOP17Iz3qaH9UDy4UVfdsLWjKQsi8-
> ka78jQKmCgG======MU9
> ks6======6mIsMxJGqaVzS70LVoU2Z9==================X_DMyrfjzc1RnPG0lfxT65====
> ==6K1
> Azu======Ru3ak1PnX9dwHzSa9w==========================_gR8iOvAu3ozxEORWO====
> ==DLV
> L0c======Ei5ez1PJnmC4gWj=============fjrr2B=============VFBZe1qYR2G1zmO====
> ==veI
> IpLl======-
> WRha8udfDsq===========3dDQDRqLJnlEqf===========dAwptvsMBHKO======wGTY
> 7Kd4======U0M6h7upgDe=========IL45bSDfxyXQ745mVKRM=========yS_upxpjbv9=====
> =ooV9
> 3hcHc======hGOTUmmoaz=======EgTwYfoZiBWfD61dOedWFL_o=======TZ38aT4ROP======
> ijhZn
> XgnNJ========TO1HKdlmC====IJh11OcV1gOUxKqgU23NIz-
> KVMO5Q====wwsaz5Ouj=======EtFxt
> 7RXk2C=========JMB8x_-LuL8S-Zu3TPUQJFStqrm4GUVxZoulKfivUljy3--
> NdUH========RYHkak
> DlJHmiF==========M4qQHS0dZksZS2W4j48Qo1PJWd7l5yKlEROwB6BCYFqI6v9=========TX
> MHLPI
> 6GijYANGn==========H5EHK8SfZdXoAsyYPgGLWsaVeErifVPhF5b9rAYFqV8=========mPSL
> 8jurw
> C89d-
> YVH4Dx===========MM2ZN0BmZrIf29lP8Yc1pnFPxEbOog6p6VKOn===========jOxbTTTjm-
> QEbHZV48gcP3eW===========2qrR3ytk7XTNuOVTShwiOMivGkK98bY============P6aw4tE
> t38dQ
> ZZ0ZKjcofXs0YjtNM=============ipKejlJQ6x5JNNQYFM8PU==============PViGkcivJm -
> paRh
> vUxp-
> WYl5YpJGzgQahLG==========================================_q2FmhN3Yp3nNcxrv1
> dhf0oH_DuNjqej5WFd1_8rF===================================ajdRDctyYAk5hpAXS
> PjKVI
> cos1Q3BiitY1Xe4nMRYnNE4dkP0j1p1D=================EghZoKrDLUW-
> f3FUfPqbOdbLLdgwWrQ
> JDNVFgEnZulxgWusZRS5HocrtYsMA9SM51EmJqPGyzus8Shs9ouDWqRsx7dzdexv3N0QeCUixYC
> g3IhA
>
> Since I m using android to call this function plz let me know the
> following code is correct or not
>
> httpGet = new HttpGet(GET_FULL_PROFILE);
> httpclient = new DefaultHttpClient();
> BasicHeader basicHeader = new BasicHeader("Authorization","GoogleLogin
> Auth=\"" + hashMap.get("Auth")+"\"");
> httpGet.addHeader(basicHeader);
> try {
> response = httpclient.execute(httpGet);
> HttpEntity entity = response.getEntity();
> InputStream is = entity.getContent();
> File opFile = new File("validfile.xml");
> if (!opFile.exists())
> opFile.createNewFile();
> FileOutputStream out = new FileOutputStream(opFile);
> copy(is, out);
> out.close();
> Log.i(LOG_TAG, "Communication completed");
> } catch (Exception e) { // TODO: handle exception
> e.printStackTrace();
> }
>
> where copy function is as follows
> private static void copy(InputStream in, OutputStream out)
> throws IOException {
> byte[] buf = new byte[128];
> int bytesRead = 1;
> while (bytesRead > 0) {
> bytesRead = in.read(buf);
> if (bytesRead > 0) {
> out.write(buf, 0, bytesRead);
> }
> }
> }
>
> plz could you send me core java code for using HttpGet or
> HttpURLConnection
>
> On May 19, 10:01 pm, "Paul (Google)" <[email protected]> wrote:
>
>
>
> > Hi Shrenik,
>
> > For accessing the Health feeds using a ClientLogin token, you'll need
> > to include the following header in your requests:
>
> > Authorization: GoogleLogin auth="yourAuthToken"
>
> > "yourAuthToken" should be replaced with the Auth value you received
> > form the ClientLogin service. Keep the quotes.
>
> > Are you using one of the Health/GData client APIs? Doing so should
> > certainly make it easier to integrate with the Health feeds. Also, if
> > you can, posting snippets of the code that you're working on can be
> > extremely helpful for debugging.
>
> > Keep the questions coming!
>
> > Paul
>
> > On May 19, 2:43 am, Shrenik Vikam <[email protected]> wrote:
>
> > > I am getting following
> > > "Oops an error has occured.
> > > Please include the following information in your error report:"
>
> > > what all HTTP header param I need to send along with it ?
>
> > > On May 18, 11:03 pm, "Paul (Google)" <[email protected]> wrote:
>
> > > > Hi Shrenik,
>
> > > > That looks correct; although, you'll need to replace "profileID" with
> > > > the
> > > > random looking, alpha-numeric string that you get from the profile list
> > > > feed. A real URL will look more like the following:
>
> > > >https://www.google.com/health/feeds/profile/ui/8qdQbFaFI8U?digest=true
>
> > > > Paul S.
>
> > > > On Tue, May 18, 2010 at 6:57 AM, Shrenik Vikam
> > > > <[email protected]>wrote:
>
> > > > > is following is the correct url for HTTPGET ?
> > > > > "https://www.google.com/health/feeds/profile/ui/profileID?digest=true"
>
> > > > > On May 17, 9:29 pm, "Paul (Google)" <[email protected]> wrote:
> > > > > > Hello Shrenik,
>
> > > > > > Once your user has authenticated, you'll need the id of the profile
> > > > > > that the user wants to access, since one account can have multiple
> > > > > > profiles. To get a list of ids, you'll want to use the "profile
> > > > > > list"
> > > > > > feed of the ClientLogin API, which is described at the following
> > > > > > location.
>
> > > > > >http://code.google.com/apis/health/docs/2.0/reference.html#ClientLogi...
>
> > > > > > One you have the id for the profile that the user is interested in,
> > > > > > you'll need to use it for the ClientLogin "profile feed", which is
> > > > > > the
> > > > > > second URL listed at the above location.
>
> > > > > > By default, the profile feed will return a list of records, or CCR
> > > > > > documents, that have been added to the profile. To get all of the
> > > > > > records in a single CCR document, you can append "?digest=true" to
> > > > > > the
> > > > > > profile feed URL. The digest parameter is described at the
> > > > > > following
> > > > > > location:
>
> > > > > >http://code.google.com/apis/health/docs/2.0/reference.html#DigParam
>
> > > > > > Thanks for your question! Certainly let us know how it goes!
>
> > > > > > Cheers!
>
> > > > > > Paul
>
> > > > > > On May 14, 4:43 am, Shrenik Vikam <[email protected]> wrote:
>
> > > > > > > I am using clientlogin method to communicate
> > > > > > > I want to get all record of a particular profile
> > > > > > > how do I get that ?
>
> > > > > > > Thanks in advance
> > > > > > > Shrenik
>
> > > > > > > --
> > > > > > > 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]<googlehealthdevelopers%
> > > > > [email protected]>
> > > > > .
> > > > > > > For more options, visit this group athttp://
> > > > > groups.google.com/group/googlehealthdevelopers?hl=en.
>
> > > > > > --
> > > > > > 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]<googlehealthdevelopers%
> > > > > [email protected]>
> > > > > .
> > > > > > For more options, visit this group athttp://
> > > > > groups.google.com/group/googlehealthdevelopers?hl=en.
>
> > > > > --
> > > > > 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]<googlehealthdevelopers%
> > > > > [email protected]>
> > > > > .
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/googlehealthdevelopers?hl=en.
>
> > > > --
> > > > 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
> > > > athttp://groups.google.com/group/googlehealthdevelopers?hl=en.
>
> > > --
> > > 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
> > > athttp://groups.google.com/group/googlehealthdevelopers?hl=en.
>
> > --
> > 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
>
> ...
>
> read more »
--
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.