Report created: 9 June 2014

Participant Information

Experience: 6 years: PHP, Node.js, JavaScript.

Development System: Ubuntu 14.04, Sublime Text 3, Node.js v0.10.28.

 

Tasks

1. Obtain authorization credentials.

Use the following dropbox account:
        test73837@gmail.com
        fasf1233
    Gmail account:
        test73837@gmail.com
        vsdv223r

Sources: download

Time spent: 30 minutes

Notes:

It was a really nice feature to generate an access token for myself on the web interface. It makes it much easier for a new developer to start hacking on his/her app. But I guess I need to get this programmatically. So here we go.

I decided to use the following module for Node.js: https://github.com/dropbox/dropbox-js

There was a bug using the NodeServer AuthDriver like this:

client.authDriver(new Dropbox.AuthDriver.NodeServer(3000));

It didn’t do what it supposed to. Still used the port 8191, but when I used {port: 3000} instead, it worked. I had to check the source code for this behavior.
I’m using an Ubuntu server in a Vagrant box, so it was not perfectly clear why the code did nothing at first. After some debugging, I figured I’ll put a console.log inside the openBrowser method to see what URL am I supposed to open in my browser. Setting a debug flag, or something like that would’ve been helpful here. Or maybe if opening a browser is not successful then some error message should show up to help the developers.

 

2. Output information about the authorized user.

Sources: download

Time spent: 30 minutes

Notes:

Most of my time went away figuring out how I could use the previously found access token in this task. Because most of the times developers work with already saved tokens, so there must be a way to re-use it.

And there actually was, I just needed to add a ‘token’ attribute to the Dropbox.Client options, and it worked as expected. But because there is no javascript documentation that I could check for this, and the getting started guide on Github won’t show too much information, I had to check the source code for the name of possible parameters for this.

 

3. Upload a file to the authorized Dropbox user.

Sources: download

Time spent: 30 minutes

Notes:

The documentation is wrong again. It mentions a “stat.revisionTag”, but the revisionTag seems to be private. I know that dropbox-js is not really considered official, but it is under dropbox’s github account, so it should be more up to date.

 

4. Create a new datastore.

Sources: download

Time spent: 1 hour

Notes:

I had some problem with this. It seems that I can’t use the unofficial Node.js dropbox api for this, because it has no methods for handling datastores. Or at least I couldn’t find it. So I searched on Google to find any other module that can do this for me. I found one, but it seems incomplete. Anyway, I checked its test files, and found a hacky solution, and it worked. I’m not sure why this is missing from the dropbox-js module.
Maybe the client-side version works on the server-side too, but I didn’t check it.

 

5. Write a record into the created datastore with the JSON information {"description": "This is a test"}.

Sources: download

Time spent: 1 hour

Notes:

It took too much time to figure out the syntax for inserting the data. At the end I used the HTTP documentation for the datastore. Because I saw in the test files how the syntax should look like, but I didn’t understand why that is. So I went ahead and checked, to make sure I’m not doing anything wrong there.
But in the end I learned what happens with the data, and how should I differentiate the parameters. And it has an interesting, but useful syntax.

 

Questions

1. Name specifically the three biggest problems you’ve encountered and how you solved them (documentation, customer support, stackoverflow, help from a friend)?

  1. My biggest problem was the missing or not up to date documentation. It says on the Github page that the Node.js version is unofficial, but still. I solved my problems looking at the source code.
  2. It seems that the datastore is not part of the dropbox-js lib.
  3. I wasn’t sure if uploading an image would work if I just read it with node, and add the data to the client.writeFile method. I found a solution in a closed issue.

2. Give an approximation of how much of your time you have spent outside looking for help outside https://www.dropbox.com/developers. (0% = I've been using https://www.dropbox.com/developers only; 100% = I've used https://www.dropbox.com/developers just for registering my app)

Actually I didn’t really used the /developers site after the initial app creation step, maybe 5% of my time. There is no documentation for Node.js, so it didn’t make sense looking at it. So I spent about 80% looking at the source code, and the rest 15% is looking up some other information on Google.

3. Have you experienced any unexpected crashes or errors? If yes, did you find the error messages useful?

Everything worked without any errors. And I liked this. An API like Dropbox’s most of the times shouldn’t give me errors, because that would mean it is unreliable. But fortunately this was not the case. And because I checked the source code quite thoroughly it seemed that the error messages would be quite helpful in any situation.

4. Name at least three ways we can improve the documentation.

  1. First there should be a documentation.
  2. But it would be a good start to update the getting started guide on Github.
  3. And some more demo application would be useful. For example uploading a real file. And there should be a sample Node.js application, now it is only a client-side todo app. So not too helpful when someone wants to create a server-side app.

5. Name at least three ways we can improve the design of the API (other than documentation).

1. Actually everything in this test was easily approachable, and when everything was together, it worked right away, so I can’t really name anything that would need an improvement regarding the API. It is nice, and the parts that I had to work with, were hidden behind some wrapper functions. So I didn’t had to check out the REST interface. The method names were clear, and the response values were useful. So all in all it is really nice work.

 

www.apiusabilitytesting.com