• General
  • My Apps
  • SDKs
  • Protocols
  • Structures
  • Methods
  • Errors
Log in Register Log out
  • General

  • My Apps

  • SDKs
    • C
    • Java
    • Javascript
    • Php
    • Swift

  • Protocols
    • HTTP JSON Protocol
      • Authentication
      • Single Connection
      • Uploading Files
    • Binary Protocol
      • Sending Binary Request
      • Sending Files
      • Receiving Binary Response
      • Receiving Files Data

  • Structures
    • Datetime
    • Event
    • Filenames
    • Metadata
    • Share
    • Tree

  • Methods
    • Intro
      • Global Parameters
      • Authentication
    • General
      • getdigest
      • userinfo
      • supportedlanguages
      • setlanguage
      • feedback
      • currentserver
      • diff
      • getfilehistory
      • getip
      • getapiserver
    • Folder
      • createfolder
      • createfolderifnotexists
      • listfolder
      • renamefolder
      • deletefolder
      • deletefolderrecursive
      • copyfolder
    • File
      • uploadfile
      • uploadprogress
      • downloadfile
      • downloadfileasync
      • copyfile
      • checksumfile
      • deletefile
      • renamefile
      • stat
    • Auth
      • sendverificationemail
      • verifyemail
      • changepassword
      • lostpassword
      • resetpassword
      • register
      • invite
      • userinvites
      • logout
      • listtokens
      • deletetoken
      • sendchangemail
      • changemail
      • senddeactivatemail
      • deactivateuser
    • Streaming
      • getfilelink
      • getvideolink
      • getvideolinks
      • getaudiolink
      • gethlslink
      • gettextfile
    • Archiving
      • getzip
      • getziplink
      • savezip
      • extractarchive
      • extractarchiveprogress
      • savezipprogress
    • Sharing
      • sharefolder
      • listshares
      • sharerequestinfo
      • cancelsharerequest
      • acceptshare
      • declineshare
      • removeshare
      • changeshare
    • Public Links
      • getfilepublink
      • getfolderpublink
      • gettreepublink
      • showpublink
      • getpublinkdownload
      • copypubfile
      • listpublinks
      • listplshort
      • deletepublink
      • changepublink
      • getpubthumb
      • getpubthumblink
      • getpubthumbslinks
      • savepubthumb
      • getpubzip
      • getpubziplink
      • savepubzip
      • getpubvideolinks
      • getpubaudiolink
      • getpubtextfile
      • getcollectionpublink
    • Thumbnails
      • getthumblink
      • getthumbslinks
      • getthumb
      • savethumb
    • Upload Links
      • createuploadlink
      • listuploadlinks
      • deleteuploadlink
      • changeuploadlink
      • showuploadlink
      • uploadtolink
      • uploadlinkprogress
      • copytolink
    • Revisions
      • listrevisions
      • revertrevision
    • Newsletter
      • newsletter_subscribe
      • newsletter_check
      • newsletter_verifyemail
      • newsletter_unsubscribe
      • newsletter_unsibscribemail
    • Trash
      • trash_list
      • trash_restorepath
      • trash_restore
      • trash_clear
    • Collection
      • collection_list
      • collection_details
      • collection_create
      • collection_rename
      • collection_delete
      • collection_linkfiles
      • collection_unlinkfiles
      • collection_move
    • OAuth 2.0
      • authorize
      • oauth2_token
    • Transfer
      • uploadtransfer
      • uploadtransferprogress

  • Errors

trash_restore

Name

trash_restore

Auth

yes

Description

Restores files or folders from the Trash back to the filesystem.

The destination, where the data will be restored can be automatically calculated via trash_restorepath or it could be specified by the user (use restoreto parameter).

If folderid='0', then all data in the Trash will be restored, as close to their original positions, as possible. If restoreto is set, then all data in the Trash will be placed into this folder.

If the destination is a shared folder, then a user to which the folder was shared, will need CREATE access to the folder.

If the current user used space + the resotred files size is greater than the user quota, then this method will restore, until the first file that goes over quota is restored. Then it will raise an error.

URL

https://api.pcloud.com/trash_restorepath

Required

ParameterDescription
fileidint file id of the restored file
folderidint folder id of the restored folder
Use fileid or folderid

Optional

ParameterDescription
restoretoint If given, then this folder will be chosen as a destination of the restored data.
metadataint If set and restoring a folder, then the metadata of the folder will have contents filled with the information about files and folders in the restired folder.

Output

On success returns the metadata of the restored file or folder.

If the root of the trash is restored and restoreto is specified, then the metadata is shown for the restoreto folder.

Else if restoreto is not specified, then result is a list restored of metadatas of the restored files / folders.

Example

{
    result: 0,
    metadata: {
        name: "Deleted folder",
        folderid: 236427,
        id: "d236427",
        parentfolderid: 0,
        thumb: false,
        isfolder: true,
        isshared: false,
        ismine: true,
        modified: "Sat, 16 Dec 2013 16:20:00 +0000",
        created: "Tue, 03 Dec 2013 15:50:22 +0000",
        isdeleted: false,
        icon: "folder",
        contents: [
        ]
    }
}

Errors

CodeDescription
1000Log in required.
1017Invalid 'folderid' provided.
1018Invalid 'fileid' provided.
1053Please provide 'fileid' or 'folderid'.
1054Please provide valid 'restoreto'.
2000Log in failed.
2003Access denied. You do not have permissions to preform this operation.
2005Directory does not exist.
2008User is over quota.
2009File not found.
4000Too many login tries from this IP address.
5000Internal error. Try again later.

2005 will be raised if:

  • restored folder is not found
  • destination folder was chosen with restoreto and is not found
2014 © pCloud. Terms and Conditions. Privacy Policy. Intellectual Property.
© pCloud. Terms and Conditions. Privacy Policy. Intellectual Property.
Reset Password
Check your e-mail for further instructions.
Reset