Publish and Revert Post Drafts
Learn how to publish draft posts and revert published posts to drafts.
Overview
When we create a blog post, it is saved as a draft post by default. Draft posts are not visible to public users. We need to publish draft posts to make them publicly available. Similarly, we can take down the publicly available posts and revert them to drafts.
Methods
In this lesson, we'll learn how to publish an already created draft post so that it is publicly available. We'll also learn how to revert a published post to a draft state to revoke its public access.
Publish a draft post
We can publish a draft post by making a POST
request to the following URL:
https://blogger.googleapis.com/v3/blogs/{blogId}/posts/{postId}/publish
This endpoint requires the blogId
of the blog that contains the post that we would like to publish, as well as the postId
of the post itself.
Request Parameters
Get hands-on with 1200+ tech skills courses.