1 Examples
Pan edited this page 2026-03-02 18:05:44 +01:00

Examples

This covers basic usage examples for the backend using curl.

  • Create user
curl -sS -X POST \
  -H "Authorization: Bearer $MASTER" \
  -d "username=testuser" \
  "$HOST/create_user"
  • Upload file
curl -sS -X POST \
  -H "Authorization: Bearer $USER_TOKEN" \
  -F "file=@./example.txt" \
  "$HOST/upload"
  • Upload with expiry date
curl -sS -X POST \
  -H "Authorization: Bearer $USER_TOKEN" \
  -F "file=@./example.txt" \
  "$HOST/upload?expires=7d"
  • List user files
curl -sS \
  -H "Authorization: Bearer $USER_TOKEN" \
  "$HOST/uploaded"
  • Download files
curl -sS "$HOST/f/0ca93f6b7707754b/example.txt"
  • Delete file
curl -sS \
  -H "Authorization: Bearer $USER_TOKEN" \
  "$HOST/delete/0ca93f6b7707754b/example.txt"