Direct Upload API

tiny[stash] Direct Upload API allows you to upload files using various HTTP libraries for programming languages or HTTP clients such as curl.

Endpoints

For file uploads: https://tinystash.undef.im/upload/file

For text uploads: https://tinystash.undef.im/upload/text

The only difference between them is that the latter always sets content-type to text/plain, whereas the former keeps the header value passed when the file is uploaded.

Headers

app-id: Required. An arbitrary string.

content-length: Required. The size of a body in bytes. Maximum file size is 20 MiB.

content-type: Optional. The default value for file uploads is application/octet-stream. Ignored for text uploads.

accept: Optional. Set to application/json to get a JSON response (plain text will be used otherwise).

Body

Raw file content or text. Compressed or chunked transfer encodings are not supported.

Examples

# Upload video (.mp4) file $ curl https://tinystash.undef.im/upload/file -H app-id:myapp -H content-type:video/mp4 --data-binary @/path/to/video.mp4 # Upload text from pipe, get JSON response $ echo 'This is my first text upload' | curl https://tinystash.undef.im/upload/text -H app-id:myapp -H accept:application/json --data-binary @-