Hi,
I actually figure this one out. So, here's Python code to insert a post:
#...authentication...
service = build('blogger', 'v3', http=http_auth)
service.posts().insert(blogId='123456789', body={'title':'Cool Title', 'content':'Interesting stuff...'}).execute()
The critical aspect is that the 'body' parameter is a dictionary. If you
want to find out what are the keys for this dictionary, just look at the
'Request body' field in the 'Try it!' section in this reference page
<https://developers.google.com/blogger/docs/3.0/reference/posts/insert#examples>
:
<https://lh3.googleusercontent.com/-1sJBmP6_f9g/VypBKov5j1I/AAAAAAAAAOw/WWMdmNUtPBwXcLPBgU1N1Z1S0pm8TPgLwCLcB/s1600/Blogger%2BAPI.png>
Hope this helps!
Celso
On Tuesday, May 3, 2016 at 4:48:48 PM UTC-7, [email protected] wrote:
>
> Hi,
>
> Is there any sample code that shows how to insert a post or create a new
> blog using the Blogger API v3 in Python?
>
> The blogger sample
> <https://github.com/google/google-api-python-client/tree/master/samples/blogger> only
> shows how to list information.
>
> I've gone so far as to be able to create a new post using the following
> code:
>
> #...authentication...
>
> service = build('blogger', 'v3', http=http_auth)
>
> service.posts().insert(blogId='xyz',
> body='').execute()
>
>
> However, which arguments should I use to create the title and content?
> What do we use the required 'body' parameter?
>
> Thank you!
> Celso M. de Melo
>
--
You received this message because you are subscribed to the Google Groups "Blogger Developer Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/bloggerdev.
For more options, visit https://groups.google.com/d/optout.
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.