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