• 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_restorepath

Name

trash_restorepath

Auth

yes

Description

For a desired file or folder from the Trash, calculates where to restore.

This method is granted that will choose such the destination folder, that ismine is true.

If the parent folder is also deleted, then this method will calculate the path by going to the parent of the folder. That way the file or folder will be restored at most at the root of the file system.

Also, if there are some name conflicts, then a new name will be generated, that is Name (k) , if there are k-1 files with the same name.

URL

https://api.pcloud.com/trash_restorepath

Required

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

Output

On success returns the follwing metadatas

FieldDescription
metadataInformation how the file or folder will look after restoring
destinationInformation about the calculated destination of the restored foldre

Example

{
    result: 0,
    metadata: {
        name: "Deleted folder",
        id: "d56986",
        folderid: 56986,
        parentfolderid: 56980,
        isdeleted: true,
        ismine: true,
        icon: "folder",
        created: "Mon, 03 Feb 2014 15:02:56 +0000",
        modified: "Mon, 03 Feb 2014 15:03:13 +0000",
        isfolder: true,
        thumb: false,
        isshared: true
    },
    destination: {
        name: "The destination folder",
        id: "d56980",
        folderid: 56980,
        parentfolderid: 0,
        ismine: true,
        icon: "folder",
        created: "Fri, 31 Jan 2014 12:57:56 +0000",
        modified: "Mon, 03 Feb 2014 15:04:32 +0000",
        isfolder: true,
        thumb: false,
        isshared: true
    }
}

Errors

CodeDescription
1000Log in required.
1017Invalid 'folderid' provided.
1018Invalid 'fileid' provided.
1053Please provide 'fileid' or 'folderid'.
2000Log in failed.
2005Directory does not exist.
2009File not found.
4000Too many login tries from this IP address.
5000Internal error. Try again later.
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