MindTouch Developer Center > MindTouch Deki > API Reference > PUT:pages/{pageid}/comments/{commentnumber}/content

Overview

public. Edit the specified comment

Uri Parameters
NameTypeDescription
commentnumberintidentifies the comment on the page
pageidstringeither an integer page ID, "home", or "=" followed by a double uri-encoded page title
Query Parameters

None

Return Codes
NameValueDescription
BadRequest400Invalid input parameter or request body (must be text MIME type)
Forbidden403Administrator access or comment author is required
NotFound404The requested comment could not be found
Ok200The request completed successfully

Message Format

Input: 
Content-type=text/plain

Output:

<comment id="{int}" href="{uri}">
    <page.parent id="{uri}" href="{uri}">
        <title>{text}</title> 
        <path>{text}</path> 
    </page.parent>
    <user.createdby id="{int}" href="{uri}">
        <nick>{text}</nick> 
        <username>{text}</username> 
         <email>{text}</email> 
    </user.createdby>
    <date.posted>{date}</date.posted> 
    <title>{text}</title> 
    <number>{int}</number> 
    <content type="{mimetype}" href="{uri}">{text}</content> 
    <user.editedby id="{int}" href="{uri}">
        <nick>{text}</nick> 
        <username>{text}</username> 
        <email>{text}</email> 
    </user.editedby>
    <date.edited>{date}</date.edited> 
</comment>

Implementation Notes

Use POST:pages/{pageid}/comments to create a new comment.

Code Samples

The following code example modifies the text of comment 1 on the home page:

Plug p = Plug.New("http://deki-hayes/@api/deki");
p.At("users", "authenticate").WithCredentials("admin", "password").Get();
DreamMessage msg = DreamMessage.Ok(MimeType.TEXT, "Updated comment text");
p.At("pages", "home", "comments", "1", "content").Put(msg);

Sample response indicating that the comment was successfully edited:

<comment id="1" href="http://deki-hayes/@api/deki/pages/29/comments/1">
    <page.parent id="29" href="http://deki-hayes/@api/deki/pages/29">
        <title>DekiWiki (Hayes)</title> 
        <path /> 
    </page.parent>
    <user.createdby id="1" href="http://deki-hayes/@api/deki/users/1">
        <nick>Admin</nick> 
        <username>Admin</username> 
        <email>admin@mindtouch.com</email> 
    </user.createdby>
    <date.posted>2007-08-23T09:52:07Z</date.posted> 
    <title/> 
    <number>1</number> 
    <content type="text/plain" href="http://deki-hayes/@api/deki/pages/29/comments/1/content">Updated comment text</content> 
    <user.editedby id="1" href="http://deki-hayes/@api/deki/users/1">
        <nick>Admin</nick> 
        <username>Admin</username> 
        <email>admin@mindtouch.com</email> 
    </user.editedby>
    <date.edited>2007-09-06T19:03:56Z</date.edited> 
</comment>
Tag page
You must login to post a comment.