このページは2007年 9月 21日, 00:21に更新されました by BrigetteK

POST:archive/pages/restore/{title}

From $1

Overview

public. Restore all revisions of a given title

Uri Parameters
NameTypeDescription
TitleString"=" followed by a double uri-encoded page title
Query Parameters

None

Return Codes
NameValueDescription
BadRequest400Invalid input parameter or request body (the page may already exist)
Forbidden403Administrator access is required
Ok200The request completed successfully

Message Format

Output:

<restored>
    <page.archive id="{int}">
        <title>{text}</title> 
        <path>{text}</path> 
        <user.deleted id="{int}" href="{uri}">
            <nick>{text]</nick> 
            <username>{text}</username> 
            <email>{text}</email> 
        </user.deleted>
        <date.deleted>{date}</date.deleted> 
        <comment>{text}</comment> 
    </page.archive>
    ...
</restored>

Implementation Notes

Use GET:archive/pages to retrieve a list of pages currently in the archive.

When a page is restored, it is moved from the page archive to its original location.  If a new page already exists at the original location, the restore will fail until this page has been removed or renamed.

Note that this feature does not restore files and subpages of the specified page.

Code Samples

The following code example restores the page in the archive called "Page Title":

Plug p = Plug.New("http://deki-hayes/@api/deki");  
p.At("users", "authenticate").WithCredentials("admin", "password").Get();  
p.At("archive", "pages", "restore", "=Page_Title").Post();

Sample response indicating that the page was restored and that it had two revisions:

<restored>
    <page.archive id="3">
        <title>Page Title</title> 
        <path>Page_Title</path> 
        <user.deleted id="1" href="http://deki-hayes/@api/deki/users/1">
            <nick>Admin</nick> 
            <username>Admin</username> 
            <email>admin@mindtouch.com</email> 
        </user.deleted>
        <date.deleted>2007-08-21T22:04:33Z</date.deleted> 
        <comment>page created, 14 words added</comment> 
    </page.archive>
    <page.archive id="4">
        <title>Page Title</title> 
        <path>Page_Title</path> 
        <user.deleted id="1" href="http://deki-hayes/@api/deki/users/1">
            <nick>Admin</nick> 
            <username>Admin</username> 
            <email>admin@mindtouch.com</email> 
        </user.deleted>
        <date.deleted>2007-08-21T22:04:56Z</date.deleted> 
        <comment>2 words added</comment> 
   </page.archive>
</restored>
タグ:
 
コメント(0)
あなたはコメントを投稿するには ログイン しなければなりません。