Dropbox API V1 Deprecated – How to Upgrade With Cloudrail

 In CloudRail

Here’s how to upgrade from Dropbox V1 to V2:

  1. Take Your Dropbox Keys.
  2. Download the CloudRail library.
  3. Create the CloudRail object.

If you are using the Dropbox API v1, you may have recently got an email in your inbox saying how the Dropbox API will be turned off:

dropbox-upgrade-email

This kind of thing happens all the time. APIs changing how you can interface with them. Updating them is always a mess, as you have to scan your code for each instance that you use the API methods and, if a method you are using is deprecated, or has changed any of its inputs, you have to make slow gradual changes and ensure that no module or functions of your application break.

I personally believe that this is why many developers will pick only one service for their applications. For example, say a developer knows that they need to do Cloud Storage implementations. Chances are, because of this hassle in changing things around when an API has been updated, they are not going to add more than one and result in double the work.

Thankfully, there is an easier way. You can set yourself up for the switching off of Dropbox API v1 AND ensure that you have the capability to add whatever Cloud Storage service you want with the free CloudRail Single Interface API. And if Dropbox, or any other API, ever changes their API again? CloudRail is quickly updated, meaning that adapting to the new change is as easy as updating your copy of the CloudRail Library.

Other benefits to the CloudRail API

(If you just want to skip to how to upgrade from Dropbox Version 1, click here)

CloudRail is a free single interface libairy. What this means is that it abstracts a range of different cloud APIs and bundles it all into a simple, elegant interface.

So, taking the most pertinent example, with CloudStorage you can set up Google Drive, Dropbox, and others with one line of code each. Once this is done, CloudRail provides functions that are exactly the same between each service. So Upload works exactly the same, with the same inputs and outputs, for all Cloud Storage services.

CloudRail doesn’t just abstract Cloud Storage however. It abstracts a range of other interfaces, including Social Media, Payment Services, Email, SMS and Location services in the form of points of interest.

Also, unlike other similar solutions, CloudRail is completely middleware free. This means no down time for your application. You are not reliant on a CloudRail server for anything.

Adding the CloudRail Library

First of all, download the library for your platform here:

Once you have the library, you will need to follow the set up instructions below for your platform:

Node.js

  • Unzip the file.
  • Create a new Node.js project or switch to an existing one.
  • Use require to include the index.js file in your code.

Or alternatively, use NPM

  • Create a new Node.js project or switch to an existing one.
  • Execute npm install –save cloudrail-si in your project’s folder.
  • Use require(“cloudrail-si”) in your code to include the library.

Now add the following setup code to your project, replacing the inputs with your own values.

const services = require(";cloudrail-si";).services;
let cs = new services.Dropbox(context, ";[clientIdentifier]";, ";[clientSecret]";, ";[redirectUri]";, ";[state]";);

Android

  • Unzip the file.
  • Create a new Android project or switch to an existing one.
  • Copy the library file (*.aar file) into your project’s lib folder.
  • Add the file as a Module to your project.

Now add the following set up code to your project, replacing the inputs with your own values.

CloudStorage cs = new Dropbox(context, ";[clientIdentifier]";, ";[clientSecret]";);

iOS

  • Unzip the file./li>
  • Create a new iOS Xcode project or switch to an existing one.
  • Copy the *.framework file into your project.
  • Make sure that it is added to “Linked Frameworks and Libraries” and “Embedded Binaries”.
  • (Optional) If you don’t want to import it on every class that you call the framework methods, you can add it to your precompiling header file (*.pch) as “#import “.

Now add the following set up code to your project, replacing the inputs with your own values.

self.service = [[Dropbox alloc] initWithClientId:self.authDic[@";dropboxKey";] clientSecret:self.authDic[@";dropboxSecret";]]

Java

  • Unzip the file.
  • Create a new Java project or switch to an existing one.
  • Copy the library file (*.jar file) into your project’s folder.
  • Add the file to your project’s build path.

Now you’ve got the library installed, you can use all the functions of Dropbox in your app. For a full overview of what you can do, and how to use these functions, you should read the Cloud Storage Documentation. However, let’s just do a quick example for uploading a file. (And remember, if you were to use another Cloud Storage provider, such as OneDrive, the following code would work for that provider as well).

Uploading a File

Node.js

Android

iOS

Java

Summary of reasons to use CloudRail for upgrading from Dropbox v1

  • When an API updates again, you don’t have to worry about updating all your code again.
  • As safe as using the providers official API; CloudRail is middleware free.
  • You can do much more than Cloud Storage, with support for other interfaces including Social Sign, Payment, Email, etc.
  • Add additional integrations as you see fit, with virtually no integration time.
Recent Posts