files/{fileid}/properties (GET)
Overview
Retrieve the properties associated with a file attachment
- REST Method: GET
- Method Access: public
Uri Parameters
| Name | Type | Description |
| fileid | int | identifies a file by ID |
Query Parameters
| Name | Type | Description |
| redirects | int? | If zero, do not follow page redirects. |
| names | string? | Comma separated list of names of properties to return. The entire value should be URI encoded including the commas. Use '*' at the start or end of a name for wildcard matches. Default: all properties |
| contentcutoff | int? | Only show property content shorter than this number of bytes. Default: 2048 |
| authenticate | bool? | Force authentication for request (default: false) |
Return Codes
| Name | Value | Description |
| OK | 200 | The request completed successfully |
| Bad Request | 400 | Invalid input parameter or request body |
| Forbidden | 403 | READ access is required |
| Not Found | 404 | Requested file could not be found |
Message Format
Response is a list of the standard property xml blocks as well as the language element.
<properties count="{int}" href="{uri}">
<property name="{text}" href="{uri}" etag="{text}">
<contents type="{text}" href="{uri}">{text}</contents>
<date.modified>{date}</date.modified>
<user.modified id="{int}" href="{uri}">
<nick>{text}</nick>
<username>{text}</username>
</user.modified>
<change-description>{text}</change-description>
</property>
<language>{language}</language>
</properties>
Implementation Notes
- This feature shows the page language. An empty language indicates culture invariant.
- READ access to the page is required to see file properties
C# Code Sample: Retrieve File Properties
The following code authenticates and retrieves all properties belonging to a file.
Sample Code
Plug p = Plug.New("http://devwiki/@api/deki");
p.At("users", "authenticate")
.WithCredentials("sysop", "password").Get();
XDoc props = p.At("files", "42", "properties")
.Get().AsDocument() Sample Response from executing Code
<properties count="1" href="http://devwiki/@api/deki/files/42/properties">
<property name="myprop" href="http://devwiki/@api/deki/files/42/properties/myprop/info" etag="4465.r2_ts2009-03-20T23:52:50Z">
<contents type="text/plain" href="http://devwiki/@api/deki/files/42/properties/myprop">new value for property</contents>
<date.modified>2009-03-20T23:52:50Z</date.modified>
<user.modified id="1" href="http://devwiki/@api/deki/users/1">
<nick>Sysop</nick>
<username>Sysop</username>
</user.modified>
<change-description>description of change</change-description>
</property>
</properties> Implementation notes
Add notes about requirements or config values
Curl Code Sample: Retrieve File Properties
The following command retrieves all properties assigned to a file with file ID = 1:
Sample Code
curl -u username:password -i http://mindtouch.address/@api/deki/files/1/properties
Sample Response from executing Code
file ID = 71, has 2 properties.
Content-Type: application/xml
<properties count="2" href="http://192.168.59.128/@api/deki/files/71/properties">
<property name="urn:deki.mindtouch.com#description" href="http://192.168.59.128/@api/deki/files/71/properties/urn%253adeki.mindtouch.com%2523description/info" etag="109.r3_ts2010-01-27T22:34:31Z">
<contents type="text/plain; charset=utf-8" size="8" href="http://192.168.59.128/@api/deki/files/71/properties/urn%253adeki.mindtouch.com%2523description">Problem?</contents>
<date.modified>2010-01-27T22:34:31Z</date.modified>
<user.modified id="1" href="http://192.168.59.128/@api/deki/users/1">
<nick>Admin</nick>
<username>Admin</username>
<email hidden="true"/>
<hash.email>64e1b8d34f425d19e1ee2ea7236d3028</hash.email>
<uri.gravatar>http://www.gravatar.com/avatar/64e1b8d34f425d19e1ee2ea7236d3028</uri.gravatar>
</user.modified>
</property>
<property name="iscopyright" href="http://192.168.59.128/@api/deki/files/71/properties/iscopyright/info" etag="106.r2_ts2010-01-21T19:54:52Z">
<contents type="text/plain" size="3" href="http://192.168.59.128/@api/deki/files/71/properties/iscopyright">yes</contents>
<date.modified>2010-01-21T19:54:52Z</date.modified>
<user.modified id="1" href="http://192.168.59.128/@api/deki/users/1">
<nick>Admin</nick>
<username>Admin</username>
<email hidden="true"/>
<hash.email>64e1b8d34f425d19e1ee2ea7236d3028</hash.email>
<uri.gravatar>http://www.gravatar.com/avatar/64e1b8d34f425d19e1ee2ea7236d3028</uri.gravatar>
</user.modified>
<change-description/>
</property>
</properties>
Implementation notes
curl flags
- -u
- Provides external user authentication. Note that if anonymous access is available and authentication is not forced, this flag may be omitted.
- -i
- Outputs the HTTP response headers. Useful for debugging.
Files
- To view a list of all files, follow the instructions here.

