Thanks Eric, this works well. I have a question about updating a profile or
notice with actual CCR data.
I'm using this code you showed to post a simple text notice:

entry = atom.Entry(title=atom.Title(text=title),
                       content=atom.Content(content_type='html',
                                            text=message))
gdata_service.Post(entry, uri=uri)

My question is: how do I add CCR elements to the atom entry in order to post
to a profile or notice?

I know it has to do with setting the extension_elements attribute of
atom.Entry but i'm not sure how.



On Wed, Dec 24, 2008 at 11:37 AM, Eric (Google) <[email protected]> wrote:

>
> Hi Kwame,
>
> The Python library doesn't include support for the Health API,
> but you can still use it with both /h9 and /health.  As you noted,
> the user will need to have previously logged into google.com/h9 for
> ClientLogin to work.
>
> A few suggestions for you:
> 1.) The content type should be application/atom+xml
> 2.) Instead of posting xml, construct and atom entry:
>
> my_entry = atom.Entry(
>    title=atom.Title(text='Subject title'),
>    content=atom.Content(content_type='html', text='message body'))
> service.Post(my_entry, ...)
>
> Eric
>
> On Dec 19, 9:39 pm, Kwame <[email protected]> wrote:
> > I'm trying to post a new notice to the register feed athttps://
> www.google.com/h9/feeds/register/default
> >
> > e.g in python
> >
> > def post_notice(gdata_service, uri):
> >
> >     post_data = """
> >     <?xml version="1.0" encoding="utf-8"?>
> >         <entry xmlns="http://www.w3.org/2005/Atom";>
> >           <title type="text">Sample Title</title>
> >           <content type="text">Sample subject line</content>
> >
> >         </entry>
> >     """
> >
> >     result = urlfetch.fetch(url=uri,
> >                             headers={'Content-Type': 'application/x-
> > www-form-urlencoded',
> >                                       'Authorization':
> > gdata_service._GetAuthToken() },
> >                             payload=post_data)
> >     return result
> >
> > result is giving 200 status code, with some Atom feed returned but
> > when I go to the h9 account profile, I can't see any new notices? What
> > could I be doing wrong? One thing I thought of was, perhaps h9 is not
> > supported yet, because the docs only give a register feed url for
> > health and not for h9
> > (https://www.google.com/health/feeds/register/default)
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to