BT

Dropbox API v2 Launched for Swift, Python, .NET, and Java

| by Sergio De Simone Follow 14 Followers on Nov 10, 2015. Estimated reading time: 1 minute |

Dropbox has announced its API v2, which supports four SDKs: Swift, Python, .NET, and Java, is generally available to developers. According to Dropbox, Dropbox API v2 is “simpler, more consistent, and more comprehensive”. Currently, API v2 does not support JavaScript and Objective-C.

Among the changes in Dropbox API v2 is a more extensive use of HTTP POST verb, including for endpoints that return structured data, such as getting the current account’s info, or a file’s metadata:

curl -X POST https://api.dropboxapi.com/2-beta-2/users/get_current_account \
    --header "Authorization: Bearer <access-token>" \
    --header "Content-Type: application/json" \
    --data "null"

curl -X POST https://api.dropboxapi.com/2-beta-2/files/get_metadata \
    --header "Authorization: Bearer <access-token>" \
    --header "Content-Type: application/json" \
    --data "{\"path\": \"/cupcake.png\"}"

All requests take JSON and return JSON structured data in their body. Additionally, a new, non-standard error code has been added to handle requests that fail due to any call-specific reason. In such cases, the API will return a 409 code, which has the advantage, Dropbox say, of not being standard, so it will be relied along by proxies or client libraries.

Dropbox API v2 also introduces new features, such as:

  • File IDs to allows developers to identify a file even if it is moved and can be used as a path replacement.
  • Shared links can be now listed and revoked, while previously it was only possible to create them; furthermore, developers will be allowed to share folders and manage policies and membership/
  • A new API explorer allows developers to test API calls from the browser to discover its features.

A feature which was present in Dropbox API v1 and has not been included yet in v2 is support for range headers in files/download. This is in Dropbox’s plan for prompt inclusion.

As mentioned, Dropbox API v2 does not support Objective-C and JavaScript. Initially, Dropbox stated they had no plan to release an Objective-C version of API v2, thus relying on Objective-C Swift interoperability. On the other hand, it seems that API v2 SDK for Swift is not ready yet to be used from Objective-C due language compatibility issues with Swift structs and enums. On the contrary, JavaScript support is planned but it is still not clear when it will become available.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT