Skip to main content
NICE CXone Expert

Scheduled CxOne Expert Maintenance - Oct 26th 11:59 pm PT - Learn More

Expert Success Center

pages/{pageid}/files/{filename}/description (DELETE)

Overview

Reset the file description

  • REST Method: DELETE
  • 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.
fileid int identifies a file by ID
pageid string either an integer page ID, "home", or "=" followed by a double uri-encoded page path

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).

Return Codes

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

Message Format

Output:

<file id="{int}" href="{uri}">
    <filename>{text}</filename> 
    <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}" /> 
    <page.parent id="{int}" href="{uri}">
        <title>{text}</title> 
        <path>{text}</path> 
    </page.parent>
</file>

Implementation Notes

Use GET:files to retrieve a list of files across the site or GET:pages/{pageid}/files to retrieve the files on a specified page.

C# Code Sample: Remove a File Description

The following code example deletes the description for myfile.jpg on the home page:

Sample Code

Plug p = Plug.New("http://help.mindtouch.us/@api/deki");
p.At("users", "authenticate").WithCredentials("admin", "password").Get();
p.At("pages", "home", "files", "=myfile%252ejpg", "description").Delete();

Sample Response from executing Code

<file id="456" href="http://help.mindtouch.us/@api/deki/files/456/info">
    <filename>myfile.jpg</filename> 
    <description /> 
    <contents type="image/pjpeg" size="53112" width="476" height="480" href="http://help.mindtouch.us/@api/deki/files/456" /> 
    <contents.preview rel="thumb" type="image/pjpeg" maxwidth="160" maxheight="160" href="http://help.mindtouch.us/@api/deki/files/456?size=thumb" /> 
    <contents.preview rel="webview" type="image/pjpeg" maxwidth="550" maxheight="550" href="http://help.mindtouch.us/@api/deki/files/456?size=webview" /> 
    <date.created>2007-08-23T19:04:53Z</date.created> 
    <user.createdby id="1" href="http://help.mindtouch.us/@api/deki/users/1">
        <nick>Admin</nick> 
        <username>Admin</username> 
        <email>admin@mindtouch.com</email> 
    </user.createdby>
    <revisions count="1" href="http://help.mindtouch.us/@api/deki/files/456/revisions" /> 
    <page.parent id="29" href="http://help.mindtouch.us/@api/deki/pages/29">
        <title>DekiWiki (Hayes)</title> 
        <path /> 
    </page.parent>
</file>

Implementation notes 

Add notes about requirements or config values

Curl Code Sample: Delete File Description

The following command deletes the description of file "foo" on page "bar":

Sample Code

curl -u username:password -X DELETE -i http://mindtouch.address/@api/deki/pages/=bar/files/=foo/description

Implementation notes 

curl flags

-u
Provides external user authentication.
-X
Specifies the HTTP request method.
-i
Outputs the HTTP response headers. Useful for debugging.

Sample Response

page name = fubar, file name = trollface.jpg

HTTP Response Headers

HTTP/1.1 200 OK
Date: Wed, 27 Jan 2010 00:24:18 GMT
Server: Dream-HTTPAPI/2.0.0.17629 Microsoft-HTTPAPI/2.0
Content-Length: 2753
Content-Type: application/xml; charset=utf-8
X-Data-Stats: request-time-ms=25; mysql-queries=16; mysql-time-ms=21;
X-Deki-Site: id="default"
Via: 1.1 dekiwiki

HTTP Response Body

Content-Type: application/xml

<file id="71" revision="5" href="http://192.168.59.128/@api/deki/files/71/info">
  <filename>trollface.jpg</filename>
  <description/>
  <contents type="image/jpg" size="88820" width="469" height="428" href="http://192.168.59.128/@api/deki/files/71/=trollface.jpg"/>
  <contents.preview rel="thumb" type="image/jpeg" maxwidth="160" maxheight="160" href="http://192.168.59.128/@api/deki/files/71/=trollface.jpg?size=thumb"/>
  <contents.preview rel="webview" type="image/jpeg" maxwidth="550" maxheight="550" href="http://192.168.59.128/@api/deki/files/71/=trollface.jpg?size=webview"/>
  <date.created>2010-01-21T22:49:09Z</date.created>
  <user.createdby id="1" href="http://192.168.59.128/@api/deki/users/1">
    <nick>Admin</nick>
    <username>Admin</username>
    <email>admin@admin.com</email>
    <hash.email>64e1b8d34f425d19e1ee2ea7236d3028</hash.email>
    <uri.gravatar>http://www.gravatar.com/avatar/64e1b8d34f425d19e1ee2ea7236d3028</uri.gravatar>
  </user.createdby>
  <revisions count="5" totalcount="5" href="http://192.168.59.128/@api/deki/files/71/revisions"/>
  <page.parent id="567" href="http://192.168.59.128/@api/deki/pages/567?redirects=0">
    <uri.ui>http://192.168.59.128/FUBAR</uri.ui>
    <title>FUBAR</title>
    <path>FUBAR</path>
    <namespace>main</namespace>
  </page.parent>
  <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.r2_ts2010-01-27T00:24:18Z">
      <contents type="text/plain; charset=utf-8" size="0" href="http://192.168.59.128/@api/deki/files/71/properties/urn%253adeki.mindtouch.com%2523description"/>
      <date.modified>2010-01-27T00:24:18Z</date.modified>
      <user.modified id="1" href="http://192.168.59.128/@api/deki/users/1">
        <nick>Admin</nick>
        <username>Admin</username>
        <email>admin@admin.com</email>
        <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>admin@admin.com</email>
        <hash.email>64e1b8d34f425d19e1ee2ea7236d3028</hash.email>
        <uri.gravatar>http://www.grav
atar.com/avatar/64e1b8d34f425d19e1ee2ea7236d3028</uri.gravatar>
      </user.modified>
      <change-description/>
    </property>
  </properties>
</file>

 

  • Was this article helpful?