Since there is no standard approach for API calls across cloud document services, developers need to be aware of the differences in functionality of each service to know how to consistently and correctly call the API. The Cloud Elements Documents Hub unifies document management across the industry’s leading cloud document and file storage services: Box, Dropbox, Google Drive, OneDrive and SharePoint. Working to unify each of these service’s API calls, developers have discovered that although each Element delivers the same type of document management services, they all take a different approach in how they deliver these services.
Below are two examples of API calls developers may make across multiple document management services:
1. Overwriting: Consider Box and Dropbox. Both are cloud document management services that support the same basic file operations (upload, download, move, copy, etc). A key distinction in the core functionality between the two becomes apparent when uploading a file that has the same name as a file already in the system. In the case of Box, attempting this operation without specifying an additional parameter in the request causes the operation to fail and throw an exception. In the case of Dropbox, no additional input is required and the old version of the file is automatically overwritten.
This issue is addressed in the Documents Hub API by having an option to specify whether or not the file should be overwritten. The underlying code handles each service differently, depending on how their respective APIs work, but from a user’s standpoint it all looks the same. It can be used the same way to overwrite any file and the end result will be the same no matter what service is used.
The overwrite option as shown in Cloud Elements’ API documentation for the Documents Hub (in Swagger).
2. File Structure: When searching for a file, most document storage services follow a traditional tree-like file structure. Others, such as Google Drive, take a very different approach to file organization. It is more a web of tags, where a single file may have multiple parents. There is no straightforward hierarchy in place, making it an interesting feat to display file paths in a format consistent with the others.
For example, some folders have a parent folder. There is usually one path to find the folder in the parent folder. But in Google Drive, folders can have multiple parents and it can appear to be in multiple folders at the same time. To display paths so it is consistent with the other Documents Hub services, the underlying code for Google Drive reconstructs all the possible paths and presents them in a familiar format. Again, this unifies the use and presentation of the APIs and data for the user, giving a consistent feel between services.
Document Management providers have different ways in which they implement APIs and present data. As developers, it is important to be vigilant on how the API is called and how it will interact with the document provider. Understanding the structure of the document providers and how they work with the API will be beneficial for all developers.
If you’re looking for more information on APIs, subscribe to our blog or check out our other posts:
- 3 Problems to Watch Out For When Using Multifunctional APIs
- Using the Google Drive API to Download Google Docs