Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
All server-side operations are evaluated by the client during a client-initiated sync call. The HTTP requests for these sync calls are all very similar regardless of the type of operations that occur server side; the primary difference is in the XML payload response received from the server. An example of the sync request is as follows:
GET https://<serverurl>/personal/<useralias>/_api/SPFileSync/sync/be100e28dd1c4f2f8e83acdb6fffff05/RootFolder?Filter=changes&InlineBlobs=false&MaxItemCount=50&SyncToken=3;%234;%231;3;be100e28-dd1c-4f2f-8e83-acdb6fffff05;636699581579070000;58172;%23;%23;%234&View=SkyDriveSync
The primary indicator of what sort of sync (if any) needs to be made is a header value in the response called X-SyncStatus. This header MUST contain one of the following string values: NoChanges, IncrementalChanges, FullData, ResyncNeeded and CurrentSyncTokenOnly.
The most common values of SyncStatus are NoChanges, IncrementalChanges and FullData. If the value is NoChanges then the client and server are in sync and no further operations are required. IncrementalChanges indicates that changes need to be synced from the server to the client. FullData is used during the first run; it indicates that a full download from the server is required and the client MUST request a complete sync. CurrentSyncTokenOnly informs the client that it MUST delete its cached sync token and retrieve a new one from the server.
ResyncNeeded is used to tell the client to perform a type of resync and has a corollary field: ResyncAction. This field has three potential values: “ResetReupload”, “Reupload” and “DifferentialUpload”. This field informs the client what type of resync is required and the client MUST support reset resyncs, reupload resyncs and differential upload resyncs. If no resync action is received the client MUST default to a reupload resync. During a reset resync the client MUST delete all local data and redownload it from the server. During a reupload resync the client MUST get the list of files on the server, compare it to its local files and reupload any files missing on the server. During a differential resync the server will send a list of files and the client MUST determine what files are not present on the list and modify the local file structure to mirror the list.