The Upload API

1 view
Skip to first unread message

Niklas Holmgren

unread,
Mar 4, 2010, 4:53:13 PM3/4/10
to bitspa...@googlegroups.com
Hi everyone,

We just put up some documentation on the Upload API, including an
example script in Ruby.

http://bitspace.at/developer

Check it out, try it out, hack it, create your own tools, whatever.
All feedback and bug reports are very appreciated.

Please remember that this is a private beta right now, so try to be a
bit discreet with the link. We don't care if you talk about it with
your friends or write about it on your blog, just use your common
sense. It's mostly because we don't want people to start using the API
on a larger scale until it is well tested and stable.

And btw, if you create any tools or apps using the API, let us know
about it and if it's any good we might put up a link to it.

Niklas

Casey Link

unread,
Mar 7, 2010, 12:17:43 PM3/7/10
to bitspa...@googlegroups.com
Hi,

Awesome first iteration! I'm working on a no frills cross-platform
upload client.

Some things I've noticed:
Using "http://bitspace.at/uploads/new?user_credentials=ApiToken" doesn't work:
<html><body>You are being <a
href="http://bitspace.at/login">redirected</a>.</body></html>

This means that the username:pass have to be passed in plaintext :(

Another thought, instead of automatically redirecting on an invalid
API call, if error information could be passed back as part of the
response header (or even json data) that would be very helpful in
error handling on the client side.

Regards,
Casey

Casey Link

unread,
Mar 7, 2010, 8:30:31 PM3/7/10
to bitspa...@googlegroups.com
I'm having some trouble crafting a HTTP Post header+data that S3 will accept.

Is the order of the S3 params (policy, key, signature, etc) important?
I am putting the file_param parameter last, as per
http://doc.s3.amazonaws.com/proposals/post.html.

Casey

Casey Link

unread,
Mar 7, 2010, 9:11:02 PM3/7/10
to bitspa...@googlegroups.com
Got it!

Seems like the trick was adding "Expect: 100-continue" to the POST
header. Just curious, why is bitspace using the POST method, instead
of the PUT method?

Here's a sneak preview of a simple cross platform uploader:
http://www.binaryelysium.com/images/bitspace_loader1.jpeg It's built
around a C++/Qt based bitspace library. I'll upload both to github as
soon as I can.

Casey

Niklas Holmgren

unread,
Mar 8, 2010, 6:58:58 AM3/8/10
to bitspa...@googlegroups.com
Hi Casey,

We have fixed an issue with the API tokens and they should now work as expected.

The API will respond with the proper HTTP status codes if you make the
requests with an "Accept: application/json" header. I think we forgot
to mention that in the documentation.

Niklas


2010/3/7 Casey Link <unnamed...@gmail.com>:

Niklas Holmgren

unread,
Mar 8, 2010, 7:14:35 AM3/8/10
to bitspa...@googlegroups.com
That looks awesome! Will you be releasing the uploader as open source,
and if so, under what license?

I will make sure we update the documentation with info about the
"Expect: 100-continue" header. The reason we are using the POST method
instead of the PUT method is to allow the file uploads to be
implemented as ordinary HTML forms, which is basically what we are
doing ourselves in the Bitspace Player.

Niklas


2010/3/8 Casey Link <unnamed...@gmail.com>:

Casey Link

unread,
Mar 8, 2010, 12:28:22 PM3/8/10
to bitspa...@googlegroups.com
Niklas,

I was wrong about "Expect: 100-continue", it is not required, so you
can remove that from the API spec if you'd like. Turns out the issue
was I was forgetting to end the data segment of the HTTP request
packet with "--"!

Thanks for fixing the API key authentication, I'll check that out.

And yea, I'll be releasing both the C++ library and the uploader under
an open source license, most likely GPL v3, or maybe LGPL for the
library.

Can't wait for the next iteration of the API :D

Casey

Reply all
Reply to author
Forward
0 new messages