|
|
GET:files/{fileid}/revisionsFrom $1目次
Overviewpublic. Retrieve file revision info Uri Parameters
Query Parameters
Return Codes
Message FormatOutput: <files count="{int}">
<file id="{int}" revision="{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}" revision="{int}" />
<contents.preview rel="webview" type="{mimetype}" maxwidth="{int}" maxheight="{int}" href="{uri}" revision="{int}" />
<date.created>{date}</date.created>
<user.createdby id="{int}" href="{uri}">
<nick>{text}</nick>
<username>{text}</username>
<email>{text}</email>
</user.createdby>
</file>
...
</files>
Implementation NotesA new file revision is created whenever a file with the same name is uploaded to the same page. Use GET:files/{fileid} with the revision parameter to retrieve the file from a specified revision. 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. Code SamplesThe following code example retrieves revision information about the file with ID 456: Plug p = Plug.New("http://deki-hayes/@api/deki");
p.At("users", "authenticate").WithCredentials("admin", "password").Get();
p.At("files", "456", "revisions").Get();
Sample response indicating that there are two file revisions: <files count="2">
<file id="456" revision="1" href="http://deki-hayes/@api/deki/files/456/info?revision=1">
<filename>myfile.jpg</filename>
<description/>
<contents type="image/pjpeg" size="53112" width="476" height="480" href="http://deki-hayes/@api/deki/files/456?revision=1" />
<contents.preview rel="thumb" type="image/pjpeg" maxwidth="160" maxheight="160" href="http://deki-hayes/@api/deki/files/456?revision=1&size=thumb" revision="1" />
<contents.preview rel="webview" type="image/pjpeg" maxwidth="550" maxheight="550" href="http://deki-hayes/@api/deki/files/456?revision=1&size=webview" revision="1" />
<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>
</file>
<file id="456" revision="2" href="http://deki-hayes/@api/deki/files/456/info?revision=2">
<filename>myfile.jpg</filename>
<description />
<contents type="image/pjpeg" size="53112" width="476" height="480" href="http://deki-hayes/@api/deki/files/456?revision=2" />
<contents.preview rel="thumb" type="image/pjpeg" maxwidth="160" maxheight="160" href="http://deki-hayes/@api/deki/files/456?revision=2&size=thumb" revision="2" />
<contents.preview rel="webview" type="image/pjpeg" maxwidth="550" maxheight="550" href="http://deki-hayes/@api/deki/files/456?revision=2&size=webview" revision="2" />
<date.created>2007-08-27T19:59:24Z</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>
</file>
</files>
タグ:
|
|||||||||||||||||||||||||||