Booth Wiki Booth Wiki
Pages

UploadBooth API Documentation

UploadBooth exposes its data via an Application Programming Interface (API). This document is the official reference for that functionality.

All API endpoints live under https://uploadbooth.com/api/. A request to the API root returns a stub notice: {"result":"API Stub, Nothing to see here, move along.","type":"notice"}

Response Format

Every JSON API response uses the same envelope:

{"result":"...","type":"notice"}

type is "notice" on success and "error" on failure; result carries the message. Some methods add extra keys (e.g. url, token). Note that most API errors return HTTP 200 with "type":"error" — check the envelope, not just the status code. See HTTP Response Codes and Errors.

Authentication

Basic Authentication sends user credentials in the header of the HTTP request. This makes it easy to use, but insecure and difficult to track. Basic Authentication is the preferred authentication at this point. I would like to follow the KISS principle on this.

Authorized requests should use HTTPS, since Basic auth sends credentials (base64-encoded, not encrypted) with every request. Without valid credentials, authorized methods respond:

{"result":"Authorize first.","type":"error"}

Client Request Header

GET /api/delete/some_batch/file1 HTTP/1.1
Host: uploadbooth.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

How to form the Authorization request

require 'base64'
encoded_string = Base64.encode64('victori:mypassword')
p "Basic #{encoded_string}"

Methods

The API supports the following methods to send and receive UploadBooth data.

REST API Methods