WARNING: API is still subject to change
Overview
- submit meta data (name, path, mime-type, size, user fields)
- receive file ids (base64 ids)
- upload files by id (ids must match)
- retrieve meta data by id (/meta/${id})
(this is useful for naming the file and showing progress) - retrieve file by id (/files/${id}/${name})
- delete files or they will be deleted automatically
after 72 hours
NOTE: if files are submitted with http auth
then they will require that auth to retrieve
CREATE meta data to retrieve ids
# request
curl dropsha.re/meta/new \\
-X POST -H 'application/json' \\
-d '[
{
"name": "logo.png"
, "path": "/home/user/images/"
, "type": "image/png"
, "size": 1048
, "lastModifiedDate": "2011-09-20T16:16:48.000Z"
}
, {
"name": "anthem.m4a"
, "path": "/home/user/music/"
, "type": "audio/mp4"
, "size": 4440
, "lastModifiedDate": "2011-11-12T03:38:08.000Z"
}
]'
# response
{
"error": false
, "errors": []
, "result": [
"xyz123"
, "abc789"
]
}
CREATE files
# request
curl dropsha.re/files/new \\
-X POST \\
--form xyz123=@/home/user/images/logo.png \\
--form abc789=@/home/user/music/anthem.m4a
# response
{
"error": false
, "errors": []
, "result": [
{
"id": xyz123
, "size": 1048
, ...
}
, ...
]
}
GET meta
You'll either get back meta data or an error
curl dropsha.re/meta/xyz123
GET file
You'll either get back the file or an error
curl dropsha.re/files/xyz123/any-name-you-like.any