• 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
    • File Descriptors
    • 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
    • Fileops
      • file_open
      • file_write
      • file_pwrite
      • file_read
      • file_pread
      • file_pread_ifmod
      • file_checksum
      • file_size
      • file_truncate
      • file_seek
      • file_close
      • file_lock
    • 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

diff

Name

diff

Auth

yes

Description

List updates of the user's folders/files.

Optionally, takes the parameter diffid, which if provided returns only changes since that diffid.

Alternatively you can provide date/time in after parameter and you will only receive events generated after that time.

Another alternative to providing diffid or after is providing last, which will return last number of events with highest diffids (that is the last events).

Especially setting last to 0 is optimized to do nothing more than return the last diffid.

If the optional parameter block is set and there are no changes since the provided diffid, the connection will block until an event arrives. Blocking only works when diffid is provided and does not work with either after or last.

However, sending any additional data on the blocked connection will unblock the request and an empty set will be returned. This is useful when you want to monitor for updates when idle and use connection for other activities when needed.

Just keep in mind that if you send any request on a connection that is blocked, you will receive two replies - one with empty set of updates and one answering your second request.

If the optional limit parameter is provided, no more than limit entries will be returned.

IMPORTANT When a folder/file is created/delete/moved in or out of a folder, you are supposed to update modification time of the parent folder to the timestamp of the event.

IMPORTANT If your state is more than 6 months old, you are advised to re-download all your state again, as we reserve the right to compact data that is more than 6 months old.

Compacting means that if a deletefolder/deletefile event is more than 6 month old, it will disappear altogether with all create/modify events. Also, if modifyfile is more than 6 months old, it can become createfile and the original createfile will disappear. That is not comprehensive list of compacting activities, so you should generally re-download from zero rather than trying to cope with compacting.

URL

https://api.pcloud.com/diff

Optional

ParameterDescription
diffidint receive only changes since that diffid.
afterdatetime receive only events generated after that time
lastint return last number of events with highest diffids (that is the last events)
blockint if set, the connection will block until an event arrives. Works only with diffid
limitint if provided, no more than limit entries will be returned

Output

On success in the reply there will be entries array of objects and diffid. Set your current diffid to the provided diffid after you process all events, during processing set your state to the diffid of the event preferably in a single transaction with the event itself.

Each object will have at least:

FieldDescription
diffidint the event's identificator
timedatetime timestamp of the event
eventevent see the possible events here
In most cases also metadata will be provided.

diffid could be used to request updates since this event. Normally diffids are incrementing integers, but one can not assume that ids are consecutive as events that cancel each other (e.g. createfolder, deletefolder) are not displayed if they happen to be in the same list.

For shares, a share object is provided.

time of the event is the time of the event - even if the event is createfolder, time is not guaranteed to be the folder's creation time. The folder might be somebody elses folder,created an year ago, that was just shared with you.

Errors

CodeDescription
1000Log in required.
1013Date/time format not understood.
2000Log in failed.
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