Body
-
files array[object]
The files to upload
-
name string
Name of the short URL to use after https://sh0rt.zip/
Default value is
<4 random characters>
. -
date string(date-time)
When to delete the short URL. Must be parseable using JavaScripts
Date()
function.Default value is
<five days from now>
.
Responses
-
201 application/json
Short URL was created successfully at the given name.
-
400 application/json
Invalid input which prevents the short URL from being created, in this case a missing url.
-
409 application/json
There is already a short URL with that name.
-
413 application/json
The total file size or the one of a single file in the payload is too large.
-
422 application/json
Invalid input which prevents the short URL from being created, such as an invalid URL or a redirect loop.
POST /
curl \
-X POST https://sh0rt.zip/ \
-H "Content-Type: application/json" \
-d '{"url":"https://github.com/DEVTomatoCake/Bundbot","files":[{"name":"index.js","content":"data:application/text;base64,\u003cbase64 encoded content\u003e"}],"name":"bundbot","date":"2024-05-24T14:58:26.710Z"}'
Request example
{
"url": "https://github.com/DEVTomatoCake/Bundbot",
"files": [
{
"name": "index.js",
"content": "data:application/text;base64,<base64 encoded content>"
}
],
"name": "bundbot",
"date": "2024-05-24T14:58:26.710Z"
}
Response examples (201)
{
"uri": "https://sh0rt.zip/bundbot",
"name": "bundbot",
"files": [
{
"uri": "file/bundbot/index.js",
"name": "index.js",
"expires": "2024-05-24T14:58:26.710Z"
}
]
}
Response examples (400)
{
"error": "missingurlbody"
}
Response examples (409)
{
"error": "name_alreadyexists"
}
Response examples (413)
{
"error": "file_too_large",
"limit": 5242880
}
Response examples (422)
{
"error": "name_invalid"
}