Skip to main content

files/{fileid}/info (GET) (TCS)


Retrieve file attachment information

  • REST Method: GET
  • Method Access: public

Uri Parameters

Name Type Description
filename string Double uri-encoded file name. Should be prefixed with "=" if it does not have an extension.
pageid string either an integer page ID, "home", or "=" followed by a double uri-encoded page title
fileid int identifies a file by ID

Query Parameters

Name Type Description
authenticate bool? Force authentication for request (default: false)
redirects int? If zero, do not follow page redirects (only applies when {pageid} is present).
includeDeleted bool When fileid is an integer ID, and this parameter is set to true, we'll even return the file info if it was deleted at some point
revision string? File revision to retrieve. 'head' by default will retrieve latest revision. positive integer will retrieve specific revision

Return Codes

Name Value Description
OK 200 The request completed successfully
Bad Request 400 Invalid input parameter or request body
Forbidden 403 Read access to the page is required
Not Found 404 Requested file could not be found

Message Format


<file id="{int}" revision="{int}" href="{uri}">
    <contents type="{mimetyp e}" 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}" /> 
    <user.createdby id="{int}" href="{uri}">
    <revisions count="{int}" href="{uri}" /> 
    <page.parent id="{int}" href="{uri}">

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.

C# Code Sample: Retrieve File Info

The following code example retrieves information about the file with ID 456:

Sample Code

Plug p = Plug.New("");
p.At("users", "authenticate").WithCredentials("admin", "password").Get();
p.At("files", "456", "info").Get();

Sample Response from executing Code

<file id="456" href="">
    <description /> 
    <contents type="image/pjpeg" size="53112" width="476" height="480" href="" /> 
    <contents.preview rel="thumb" type="image/pjpeg" maxwidth="160" maxheight="160" href="" /> 
    <contents.preview rel="webview" type="image/pjpeg" maxwidth="550" maxheight="550" href="" /> 
    <user.createdby id="1" href="">
    <revisions count="2" href="" /> 
    <page.parent id="29" href="">
        <title>DekiWiki (Hayes)</title> 
        <path /> 

Implementation notes 

Add notes about requirements or config values

Curl Code Sample: Retrieve File Ino

The following command retrieves the information of a file with file ID = 1:

Sample Code

curl -u username:password -i http://mindtouch.address/@api/deki/files/1/info

Sample Response from executing Code

file ID = 70, file name = batman.xml

<file id="70" revision="9" href="">
  <contents type="text/xml" size="371" href=""/>
  <user.createdby id="1" href="">
    <email hidden="true"/>
  <revisions count="1" totalcount="9" href=""/>
  <page.parent id="565" href="">

Implementation notes 

curl flags

Provides external user authentication. Note that if anonymous access is available and authentication is not forced, this flag may be omitted.
Outputs the HTTP response headers. Useful for debugging.


To view a list of all files, follow the instructions here.
  • Was this article helpful?