Updating blog posts
Added by IBM contributorIBM | Edited by IBM contributorPaul Bastide on December 21, 2015
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

To update a blog post, send a replacement blog post entry document in Atom format to the existing blog post's edit web address.

All existing blog post information will be replaced with the new data. To avoid deleting all existing data, retrieve any data you want to retain first, and send it back with this request. For example, if you want to add a new tag to a blog post, retrieve the existing tags, and send them all back with the new tag in the update request.

To update a blog post, complete the following steps:

1. Retrieve the Blogs service document. See Retrieving the Blogs service document.
2. In the service document, find the workspace for the blog from which you want to retrieve the post, and then retrieve the web address of the "weblog Entries" collection in that workspace.
3. Send a GET request to the weblog Entries collection.
4. In the returned feed, find the entry and note down the value of the href attribute of its <link rel="edit" type="application/atom+xml" ... > element.
5. Send a PUT request to the web address defined in the href attribute and pass in a new blog post entry document that includes your changes.
Input
Method URI Description
PUT /blogs/{handle}/api/entries/{entryId} Value of the href attribute of the <link rel="edit"> element of each entry in the weblog Entries feed.
Content Type: application/atom+xml
Name Type Optional Description
entryId
string No The ID of the blog entry.
handle
string No handle represents the blog handle of the blog configured to be the home page of the Blogs application. The handle is defined when the home page blog is created by the administrator.
The handle can be the Community Uuid.
Output
Code Description
200
Indicates that the blog post was successfully updated. If an error occurs, this header contains one of the error codes.
403
Forbidden: Authorization failed.
404
Not Found.
401
Unauthorized. Returned when no authenticated user or no userid, email, or key parameter are provided on the request.