
Dropbox API v2 launches - leahculver
https://blogs.dropbox.com/developers/2015/11/dropbox-api-v2-launches-today/
======
awakeasleep
No love after begging for an administration API for 2+ years.

At this point they should start putting some spin on it.

"Help your company employ more people. Dropbox for Business's lack of
administration tools will grow your headcount. When you see your admins
waiting for a list of users to load, or trying to write their own tools based
on scraping the website, feel good about how you're fighting unemployment."

~~~
smarx
Our goal is definitely to give administrators the control they need through
the API, but I'm very willing to believe there are things we're missing. :-)
Is there something specific that's not already part of our Dropbox Business
API?
([https://www.dropbox.com/developers/documentation/http#teams](https://www.dropbox.com/developers/documentation/http#teams))

~~~
awakeasleep
I didn't see this. Huge step in the right direction.

I don't suppose there is a way to programmatically consume the activity stream
and pick events to undelete, too?

I'm sorry I can't edit the smug sassiness out of my original reply.

~~~
smarx
It's not in v2 yet (coming soon!), but check out /log/get_events [0] in v1.
I'm not sure that it will cover what you want if you're looking for file
changes. That might be better served with webhooks, /files/list_folder and
/files/list_folder/continue. Feel free to post on the developer forum if you
want more help! [1]

[0] [https://www.dropbox.com/developers-v1/business/docs#log-
get-...](https://www.dropbox.com/developers-v1/business/docs#log-get-events)

[1] [https://www.dropboxforum.com/hc/en-
us/community/topics/20020...](https://www.dropboxforum.com/hc/en-
us/community/topics/200209245-API-Development)

------
jl6
Hey if anyone from Dropbox is monitoring these comments: nice work, but
there's something missing that I've been waiting for: API access to comments.

I'd love to recommend using the new Dropbox comments feature but I can't until
I know there is a way of getting that data out after putting it in. I'm not
entering metadata into a system that doesn't have fully programmable export.
Been burned too many times.

Pretty please?

~~~
smarx
Thanks for the feedback! This is definitely already being tracked as a feature
request, but I don't have anything to share about if/when we'll add comments
support to the API.

------
DenisM
So is this the API for clients or for servers?

I would like my web server to be able to slurp up all the images from my
customer's Dropbox. Unfortunately, shared folders can't be downloaded if they
are larger than 2Gb, which is quite often for me.

Is there an API suitable for this?

EDIT: oh yes, yes there is!
[https://www.dropbox.com/developers/chooser](https://www.dropbox.com/developers/chooser)

EDIT 2: It would be sweet if you guys also exposed SHA2 hash of the files in
Choser. Often times they user will mistakenly load the same file, and I would
rather not do the work at all if I don't have to.

------
cllu
One thing I cannot understand is that Dropbox API does not provide any kind of
hash for files (in both v1 and v2). In contrast, Amazon Cloud Drive and Google
Drive provides md5 hash, and OneDrive provides sha1Hash and crc32Hash. The
lack of hash info makes custom app to compare and upload local files extremely
painful.

~~~
dmix
Git annex [1] is a far more capable solution for file syncing and remote
backups. It comes with a built-in assistant which syncs directories making it
an adequate Dropbox replacement.

Git annex automatically uses SHA256 on all files as the UUID (optionally set
SHA512 in .gitattributes). You can PGP sign your git commits to add more
verification.

Plus you dont have to trust a 3rd party with your data, as it can sync
entirely over local networks via SSH, directly to a USB harddrive, and it
supports encryption when using S3 or other cloud storage.

I managed to teach my non-technical girlfriend how to use it without much
effort but getting business people to use it might be a hurdle.

[1] [https://git-annex.branchable.com/](https://git-annex.branchable.com/)

------
dietcokerules
Love the layout of the API Explorer. Makes it easy to see exactly what is
being requested.

------
muyfine
Is there an accessible description of the API? i.e., what's driving the "code
generation process"? Is that open and something I could use to generate a
client for <insert my favorite language here>?

~~~
smarx
Stay tuned for more details! The short answer is that yes, you'll be able to
do that, but we haven't published that API description yet.

------
teleclimber
The Dropbox Badge thing looks neat [1] but I don't see any indication of an
open API so that non-Microsoft applications can take advantage of it. Does
anyone know if there are any plans for that?

[1] [https://www.dropbox.com/help/7670](https://www.dropbox.com/help/7670)

------
tacos
"There are currently four SDKs for API v2: Swift, Python, .NET, and Java." And
a structured, non-REST API.

Aw. All grown up.

~~~
BinaryIdiot
Initially I was surprised Swift, a new language, came before JavaScript. But
after thinking about it you have to have it for iOS integration.

It's too bad their JavaScript SDK isn't ready yet but making HTTP calls from
JavaScript is dead simple so that's not the worst thing.

Overall looks like a good set of priorities for what SDKs got done first.

~~~
denniskane
Well, if JavaScript were meant to be used as an _actual_ programming language,
then it would make sense to develop an SDK for it.

I'm only half joking there :)

In all seriousness, though, it did make my brain tilt about 15 degrees to see
the words "JavaScript" and "SDK" next to each other like that.

~~~
dsp1234
_In all seriousness, though, it did make my brain tilt about 15 degrees to see
the words "JavaScript" and "SDK" next to each other like that._

AWS has two JavaScript SDKs.

[https://aws.amazon.com/sdk-for-browser/](https://aws.amazon.com/sdk-for-
browser/)

[https://aws.amazon.com/sdk-for-node-js/](https://aws.amazon.com/sdk-for-node-
js/)

~~~
smarx
And Dropbox has one for API v1: [https://github.com/dropbox/dropbox-
js](https://github.com/dropbox/dropbox-js). There will be one for v2 as well.

------
pixie_
A simple POST based API? What is this blasphemy?

~~~
conradk
As long as everything is well documented, I don't see the problem. With most
languages, you'll probably want to use an SDK anyway.

What's the problem with a POST based API?

~~~
waterside81
pixie_ was being sarcastic - alluding to how "RESTful" APIs with the wide
array of verbs is en-vogue in some circles.

------
chrdlu
Love the new features. I was hoping to see the ability to programmatically
create File Requests. Looks like it might still be a while before it gets
implemented.

------
robitor
Why would they choose RPC style endpoints over REST?

~~~
swax
Because REST is a superficial standard and people are starting to figure that
out? APIs don't need to be complicated. Give me an endpoint to call and
parameters to send. I don't need verbs, cool looking URLs, overloaded headers,
special versioning schemes, and a never ending debate of what REST is and what
it isn't. Also if anyone replies to this with 'you just don't understand REST'
I'm going to put another nickel in the jar.

~~~
BinaryIdiot
You are apparently me.

I've done REST and "rest" for many years and every single time it starts out
really simple. Oh I just need the profile data so let's make a RESTful
endpoint just for profile. So easy! Oh wait the profile page need data from X,
Y and Z. Well we gotta be RESTful so let's make 4 HTTP calls. Oh, latency
sucks on mobile and terrible networks and we have to cut down on HTTP calls?
Sorry, can't, we're RESTful...okay fine ONE RPC endpoint for the profile
page's information.

I think REST has it's place; it's good if you want a really intuitive way to
access a very specific resource. Beyond that? For developing web apps? Almost
always have to go down the RPC route and there is nothing wrong with that. Not
everything has to be "RESTful" damn it!@

~~~
dragonwriter
> Oh wait the profile page need data from X, Y and Z. Well we gotta be RESTful
> so let's make 4 HTTP calls.

There's nothing RESTful about making more HTTP calls. There's no reason that
there can't be representations of a resource in a RESTful API that happen to
include, in the representation rather than by reference, representations of
subresources.

(You probably would want to have authoritative URLs for the subresources _in_
the representation, assuming the media type of the representation is one which
supports that.)

~~~
BinaryIdiot
> There's nothing RESTful about making more HTTP calls. There's no reason that
> there can't be representations of a resource in a RESTful API that happen to
> include, in the representation rather than by reference, representations of
> subresources.

Sub resources sure but I'm not talking about sub resources because sub
resources are dead easy. This is more of a "oh we should also display resource
X, Y and Z in these different spots".

If you want to be really "RESTful", TYPICALLY (and I say typically because I
think every developer has a different definition of REST, lol), your URLs only
align to resources so joining resources means multiple calls.

Google has an interesting solution for batch HTTP requests that could kinda be
used in a way to batch RESTful requests but it's not the most intuitive.
[https://developers.google.com/drive/web/batch](https://developers.google.com/drive/web/batch)

~~~
dragonwriter
> Sub resources sure but I'm not talking about sub resources because sub
> resources are dead easy. This is more of a "oh we should also display
> resource X, Y and Z in these different spots".

The profile page is the resource (or a representation of the resource)
identified by the URL (Uniform Resource Locator) used to access the profile
page. This is true, pretty much by definition.

Whatever is designed as part of that page, and is also a resource, is a
subresource.

> If you want to be really "RESTful", TYPICALLY (and I say typically because I
> think every developer has a different definition of REST, lol), your URLs
> only align to resources so joining resources means multiple calls.

URLs align to resources in that the fact that a URL is used to access
something _defines it_ as a resource. There is nothing in REST which defines
resources as _only_ the orthogonal entities in a data mode (e.g., the loose
equivalent of entities in the base tables of a relational DB model.)

You certainly in many cases, for maximum flexibility, want your resources to
_include_ those kinds of things, but there is no reason -- at least none that
has anything to do with REST -- for them to be limited to them.

~~~
BinaryIdiot
> The profile page is the resource (or a representation of the resource)
> identified by the URL (Uniform Resource Locator) used to access the profile
> page. This is true, pretty much by definition. > Whatever is designed as
> part of that page, and is also a resource, is a subresource.

No that's not true at all. Your API design should not influence the user
experience but the other way around and you're unlikely to change models
should you have more optimal ways to presenting things.

On paper? Sure but I've never seen anything able to be split so nicely as you
describe.

------
avidas
Sample app link here is broken [https://github.com/dropbox/dropbox-sdk-
python/blob/master/ex...](https://github.com/dropbox/dropbox-sdk-
python/blob/master/example/back-up-and-restore/backup-and-restore-sample.py)

~~~
leahculver
Thanks for letting us know. We'll get that fixed (I'm an employee). Here's the
correct link: [https://github.com/dropbox/dropbox-sdk-
python/blob/master/ex...](https://github.com/dropbox/dropbox-sdk-
python/blob/master/example/back-up-and-restore/backup-and-restore-example.py)

------
JupiterMoon
So could one use this to manage encrypted files stored in Dropbox?

------
cryptoz
Is the Dropbox client fully open source yet? I won't use a spying tool that
hires international spies to be on the board if they continue to be closed-
source and intent on spying. Their new SDKs seem to be open source - why not
their main client product?

~~~
flyt
What are you worried about in the client app that would require it to be open
source? Should they also open source their backend systems and give you access
to them?

~~~
ohitsdom
There was serious concern with some evidence a few years back that the Dropbox
client was touching files in folders that weren't shared. Not sure if that is
what OP's concern is. But I agree with your point, the client is only one
small piece of the puzzle and won't reveal much.

~~~
tpopp
This concern pops up every once in a while because people like to put it out
of context. Most operating systems don't allow any way to poll for file events
in a specific folder only, so you either keep looping through all files in the
folder looking for changes which would be an annoying resource hog or you get
all events and ignore changes that don't occur in the folder of interest. It's
completely fair to say that any installed application can do whatever it wants
so you are concerned, but the touching files part is just people wanting to
complain.

------
fiatjaf
Can I programmatically edit .xls files over the API? That would be great.

~~~
swiley
It's a storage api not a spreadsheet api. Dropbox itself can't do that, but it
can get you the data and you can use an xls library or program to edit them.

