Overview

public. Retrieve information for all attached files

Uri Parameters

None

Query Parameters
NameTypeDescription
numfilesint?Number of files to retrieve. 'ALL' for no limit. Default: 100
skipint?Number of files to skip. Default: 0
Return Codes
NameValueDescription
BadRequest400Invalid input parameter or request body
Forbidden403Read access to the page sis required
Ok200The request completed successfully

Message Format

Output:

<files count="{int}">
    <file id="{int}" href="{uri}">
        <filename>{text}</filename> 
        <description>{text}</description> 
        <contents type="mimetype" size="{int}" width="{int}" height="{int}" href="{uri}" /> 
        <contents.preview rel="thumb" type="{mimetype}" maxwidth="{int}" maxheight="{int}" href="{uri}" /> 
        <contents.preview rel="webview" type="{mimetype}" maxwidth="{int}" maxheight="{int}" href="{uri}" /> 
        <date.created>{date}</date.created> 
        <user.createdby id="{int}" href="{uri}">
            <nick>{text}</nick> 
            <username>{text}</username> 
            <email>{text}</email> 
        </user.createdby>
        <revisions count="{int}" href="{uri}" /> 
    </file>
    ...
</files>

Implementation Notes

The contents.preview element only exists if a file preview is available.  Preview generation requires the file to be an image and fall within a certain size.

Files in the archive are not included in the output.

Code Samples

The following code example retrieves a list of files across the site:

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

Sample response indicating that there is one file:

<files count="1">
    <file id="456" href="http://deki-hayes/@api/deki/files/456/info">
        <filename>myfile.jpg</filename> 
        <description /> 
        <contents type="image/pjpeg" size="53112" width="476" height="480" href="http://deki-hayes/@api/deki/files/456" /> 
        <contents.preview rel="thumb" type="image/pjpeg" maxwidth="160" maxheight="160" href="http://deki-hayes/@api/deki/files/456?size=thumb" /> 
        <contents.preview rel="webview" type="image/pjpeg" maxwidth="550" maxheight="550" href="http://deki-hayes/@api/deki/files/456?size=webview" /> 
        <date.created>2007-08-25T00:11:01Z</date.created> 
        <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>
        <revisions count="2" href="http://deki-hayes/@api/deki/files/456/revisions" /> 
    </file>
  </files>
Tag page
You must login to post a comment.
Powered by MindTouch Deki v.8.08