Skip to main content
NICE CXone Expert

We will be closed on Thursday November 28th & Friday November 29th due to the Thanksgiving Holiday

Expert Success Center

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

Overview

Retrieves file info for a deleted file

  • REST Method: GET
  • Method Access: public

Uri Parameters

Name Type Description
fileid int identifies a file by ID

Query Parameters

Name Type Description
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 Administrator access is required
Not Found 404 Requested file could not be found in the archive

Message Format

Output:

<file.archive 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>
    <user.deletedby id="{int}" href="{uri}">
        <nick>{text}</nick> 
        <username>{text}</username> 
        <email>{text}</email> 
    </user.deletedby>
    <date.deleted>{date}</date.deleted> 
    <page.parent id="{int}" href="{uri}">
        <title>{text}</title> 
        <path>{text}</path> 
    </page.parent>
</file.archive>

Implementation Notes

When a file is deleted, it is moved into the archive. It will remain in the archive until it is either permanently deleted (DELETE:archive/files/{fileid}) or restored (POST:archive/files/restore/{fileid}).  While a file is in the archive, it cannot be modified.

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 Archived File Info

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

Sample Code

Plug p = Plug.New("http://help.mindtouch.us/@api/deki");
p.At("users", "authenticate").WithCredentials("admin", "password").Get();
p.At("archive", "files", "456", "info").Get();

Sample Response from executing Code

<file.archive id="456" href="http://help.mindtouch.us/@api/deki/archive/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/archive/files/456" /> 
    <contents.preview rel="thumb" type="image/pjpeg" maxwidth="160" maxheight="160" href="http://help.mindtouch.us/@api/deki/archive/files/456?size=thumb" /> 
    <contents.preview rel="webview" type="image/pjpeg" maxwidth="550" maxheight="550" href="http://help.mindtouch.us/@api/deki/archive/files/456?size=webview" /> 
    <date.created>2007-08-24T20:44:02Z</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>
    <user.deletedby id="1" href="http://help.mindtouch.us/@api/deki/users/1">
        <nick>Admin</nick> 
        <username>Admin</username> 
        <email>admin@mindtouch.com</email> 
    </user.deletedby>
    <date.deleted>2007-08-24T20:44:08Z</date.deleted> 
    <page.parent id="29" href="http://help.mindtouch.us/@api/deki/pages/29">
        <title>DekiWiki (Hayes)</title> 
        <path /> 
    </page.parent>
</file.archive>

Implementation notes 

Add notes about requirements or config values

Curl Code Sample: Retrieve Archived File Info

The following command retrieves information of an archived file (file.archiveID = 1):

Sample Code

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

Sample Response from executing Code

file.archiveID = 72.

<file.archive id="72" revision="2" href="http://192.168.59.128/@api/deki/archive/files/72/info">
  <filename>birds.jpg</filename>
  <description/>
  <contents type="image/jpeg" size="13303" width="500" height="378" href="http://192.168.59.128/@api/deki/archive/files/72/=birds.jpg"/>
  <contents.preview rel="thumb" type="image/jpeg" maxwidth="160" maxheight="160" href="http://192.168.59.128/@api/deki/archive/files/72/=birds.jpg?size=thumb"/>
  <contents.preview rel="webview" type="image/jpeg" maxwidth="550" maxheight="550" href="http://192.168.59.128/@api/deki/archive/files/72/=birds.jpg?size=webview"/>
  <date.created>2010-01-26T23:57:34Z</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>
  <user.deletedby 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.deletedby>
  <date.deleted>2010-01-26T23:57:34Z</date.deleted>
  <user-action type="deleteflag"/>
  <page.parent id="571" href="http://192.168.59.128/@api/deki/pages/571?redirects=0">
    <uri.ui>http://192.168.59.128/Gotham</uri.ui>
    <title>Gotham</title>
    <path>Gotham</path>
    <namespace>main</namespace>
  </page.parent>
</file.archive>

Implementation notes 

curl flags

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

Permissions

ADMIN permission is required to execute above command.

Archived Files

To view a list of archived files, follow the instructions here.

 

  • Was this article helpful?