We've been using the Dropbox Sync API in our iOS app for the last couple of years. This API allows us to treat the user's Dropbox folder like a second file system, making it simple to access the contents. It also downloads and uploads new versions of files automatically, so we have to do very little work other than hooking it into our application. In short, it's a nice API that abstracted away all the "difficult bits" (file caching, etc) that was a pleasure for us to use.
Unfortunately, Dropbox are turning off the Sync API at the end of June, so we need to find an alternative. Moving to the new Dropbox "v2 API" would require us to reimplement the "difficult bits" of the old Sync API to provide the same functionality to users, so we're looking for alternatives in case there's a simpler solution.
Are there APIs to allow an app to access the user's Google Drive or OneDrive files, that are as simple to use as the old Dropbox Sync API? Ideally I want the API to handle all the caching automatically, so that we only have to say "open file X" or "overwrite file Y", and have it handle all the difficult bits (do I check the server for a new version of the file? What if I'm offline? Do I have a cached version saved here already? etc).
Or is that an outdated model, and we should just plan to use Apple's UIDocumentPicker API instead, to allow access to whatever cloud services the user has installed on their device?
Related
I need to upload files to a client's shared folder on OneDrive, however, there's no way I can get them to allow Files.WriteAll for my application (I'm using application permissions, not delegation) -- I've asked them. Is there another way to do that?
I have looked into multiple SO questions about this and on Microsoft's documentation, and I believe it is not possible, but I would like to know from people with more experience using Microsoft's service if it is indeed true.
I have found some, but not all, pieces of the puzzle.
Using Graph APIs, when a user selects a document in my own web application, I can:-
Create a new temporary folder in their OneDrive account
Upload my.docx file to this location
Get the url for my.docx
Open the URL in a new tab, loading Office 365's MSWord editor (or viewer and editor after one more click)
This is where it gets a bit trickier. How can I get the edited content back into the location where my web application historically stored these documents?
Theorising, I can:-
Create a webhook subscription to the new folder I create
Implement a webhook listener (and validation) service
When the listener receives an 'update' notice for the document:-
Call the download(content) API, or from the driveItem metadata, download it from #microsoft.graph.downloadUrl
Persist it to my desired location within my web application
To me this sounds like it'll suffer from big delays. The webhook subscriptions typically send batches of changes and the frequency looks uncertain. It certainly wouldn't be great for versioning every individual save operation during the editing session.
Have I missed some more obvious path to Word as a Service? i.e. another API or a mixture of APIs?
Alternatives I've considered but haven't yet scoped: implement WOPI or WebDav within my own web application.
It sounds like you're only using OneDrive to take advantage of its built-in support for the MS-WOPI protocol. WOPI is basically an enhanced WebDav interface that is used by Office to work with remote document (i.e. files stored on OneDrive, Box, DropBox, etc.).
Your solution is generally fine and it is certainly easy enough to orchestrate. You can absolutely use webhooks to subscribe to changes to the file. You'll likely want some mechanism in your app to notify your system when they're "done" so you can clean up the file afterwards.
If you want a more robust solution, you'll need to look at WOPI. Implementing WOPI would allow you to keep these files on your system permanently. Office Online would use the WOPI interface to speak with your storage system and open/save/edit files in-place.
Keep in mind that implementing WOPI (or any protocol for that matter) is often a non-trivial endeavor. You will also need to get your final solution validated and whitelisted by Office before it can be used. Details on this process and how to request access can be found at the Microsoft Cloud Storage Provider Program website.
Today OneNote and Excel are the only office "document clients" that have API's exposed via a REST API publicly available in the Microsoft Graph.
The only other "publicly available options" I'm aware of are:
WOPI APIs, that kind of act like a REST API but muche older
The office add-in model (hosted in a client) with the JavaScript API
The word object library (old, relying on dcoms and needs to have office installed and licensed on the machine)
I am trying to write an app using Codename One that can read/write to Dropbox.
I noted that the Dropbox add-in uses OAuth 1.0, and the access to Dropbox is read-only, which is not useful for what I want to do.
Are there plans in CN1 to implement Dropbox read/write ability?
This is critical for CN1 to be useful for this application.
Codename One has a Dropbox SDK which is based on OAuth 1.0.
You can implement it to store and retrieve files to and from Dropbox.
There's a full blog about it here and you can view the source project on GitHub here, it may be a little old and there might be a newer version.
The good thing is that, it's open source...so you can also contribute to it.
I am developing an iOS application (to be deployed on the App Store) that requires content updates on a weekly basis.
I understand that the best way to achieve this would be to use a server, where the app would query for new data and download responses in JSON. However I am not knowledgeable when it comes to HTML, PHP or MySQL and therefore am endeavoring to find an alternative.
Here's an idea: using Dropbox to substitute for a server backend. My app connects to one central Dropbox account, checks for new files, and downloads them if present.
Is this idea feasible? If not, are there any alternatives?
Dropbox cannot be a dependable substitute for your server/backend for following reasons:
Dropbox uses OAuth for authentication, which needs user interaction. You do not want your app users to go through Dropbox authentication with your 'common' credentials.
Users who have a Dropbox account or the app installed, will most likely use their own credentials to login which completely breaks your flow.
Drobox, although a good way of sharing and syncing files is not meant for more meaningful data like web services etc or user/database interaction etc. Just syncing JSON file may suffice your app's needs for now but from a long term perspective you want a proper back end.
As suggested in the comment by #tkanzakic you can use one of the substitution services if you don't want to get too technical on the backend.
I am pretty late to the party, but this is possible and not necessarily a stupid idea (though this depends on what you need). You might want to have a look at remote storage for example, which allows you to use Dropbox among other providers as backend.
For sure, you can use the Dropbox Sync API to achieve this (https://www.dropbox.com/developers/sync).
As a background I have been looking to implement syncing with Dropbox within my application. It will deal with multiple files residing in folders across a users Dropbox.
Initially the Sync API seemed perfect for this however it does not allow the app to have Full Dropbox Access which is a must. I considered the 'File type' permissions type but some of the file types that my app will need access to are not listed as choices.
Are there any alternatives to the Sync API which give Full Dropbox Access or will I be needing to write a solution based upon the Core API to do this?
What file types do you need? We (Dropbox) do add new file types over time, so we're always looking for feedback.
For Full Dropbox access, yes, you'll have to use the Core API.