-
Notifications
You must be signed in to change notification settings - Fork 0
API
Joshua edited this page Sep 15, 2020
·
6 revisions
curl -d "TEXT OR @DATA" -H "Token: YOUR_TOKEN" -X POST "YOUR IP/DOMAIN":1024
POST request to the server on port 1024 with the following headers:
- Upload token ("Token": "TOKEN_HERE")
- File type ("Content-Type": "mime/type") (optional)
- File to be uploaded (text, image, etc.)
If all conditions are met, the API will respond with 200 File Uploaded
and response body will have the URL to the file and a unique ID for the upload.
- If the file exceeds the upload limit (default is 10mb), the API will respond with 431 Request Header Fields Too Large.
- If an incorrect token is provided, the API will respond with 401 Unauthorised.
- If the file type is invalid, the API will respond with a 500 Internal Server Error. (Will be given it's own error code eventually)
- If an unexpected error occurs, the API will respond with 500 Internal Server Error.
curl -H "Token: YOUR_TOKEN" -H "File: FILENAME_HERE" "YOUR IP/DOMAIN":1024
DELETE request to the API on port 1024 with your token in the Authorization header and the file name in the request body.
If all conditions are met, the server will respond with 200 File Deleted.
- If no token is provided, the API will respond with a 401 Unauthorised.
- If the requested file can't be found, the API will respond with 404 File Not Found.
- If an unknown error occurs, the server will respond with 500 Internal Server Error.
- GET requests to the API will be met with 405 Method Not Allowed.