Changes list

Managing changes API response for multiple sites

OVERVIEW

The 3.4.x implementation of changes API, provides changes for either

  • All sites

  • Individual site based on site ID

There was no implementation or option to provide a list of sites and obtain changes for only those sites. In order to make that possible we have extended the changes API.

Solution:

In order to address this issue, Collaborate will maintain a list of sites that are being synced for each API client based on "sourceclient" parameter.

 

  • Register folder for API client based on sourceclient

    • Parameter saved for the client are : site id, folder id, sourceclient, date/time stamp, userid

    • The API endpoint is of the format 
      POST        /api/1/changes/{sourceclient}/folder

  • Remove folder registration for HighQ Drive based on sourceclient

    • The Parameter will be the Collaborate folderID and the sourceclient

    • The API endpoint is of the format
      DELETE    /api/1/changes/{sourceclient}/folder/{folderid}

  • Remove all folder registrations for HighQ Drive

    • The API endpoint can be of the format
      DELETE    /api/1/changes/{sourceclient}/folders

 

When the API client wants to get the changes related to a specific folder they will called the “Register folder for API client” to register that site / folder for the specific sourceclient.

After registration of the sync folder, when the user calls the changes API with siteID = 0, Collaborate will check the list of sites registered for that sourceclient and send only the changes for the sites that the sourceclient has registered.

The API client will need to call the “Remove folder registration from API client” when they want to remove monitoring changes to the specific folder

The API client can remove monitoring of all folders from the changes list by calling “Remove all folders registrations for API client” API.

Not Covered :

 

Please note that the following things are not covered in this API.

 

  • Irrespective of how many folders are selected for sync for a given site, all site activity will be send to the sourceclient. The activity sent is not sync folder specific.

  • Permissions will not be considered at this point in time, and if a change has happened within a folder or file that the sourclient has no longer access to, the changes API will still send the change information to the client although only the ID of the changed document or folder is sent. The reason for this limitation at this time is because when a document is deleted, the change has to be sent to the sourceclient so that the document can be deleted if required, however after deletion from Collaborate the sourceclient no longer has access to the document.

  • API client will receive an update of any change in the site, and will have to ignore the files that the API client is not monitoring for change. This will mean that the API client will have to keep a list of all of the folders that are being synced along with its parent hierarchy, and also the list of all folders that are outside the sync hierarchy so that it can ignore the files if it belongs to a folder outside its sync hierarchy.

Please note that due to above two limitations, sourceclient will be sent a lot of change information which is not relevant to it, and the sourceclient will have to ignore all such change information.

 

 

 

 

Comments


0 Comments

Last Updated: Nov 08,2024