# dj.su HTTP API Shared-room text + file store. No auth. Replace `ROOM` with the room name. ## Text | Action | Method | URL | |---------|--------|--------------------------------------| | Read | GET | `https://raw.dj.su/ROOM` | | Replace | PUT | `https://dj.su/api/rooms/ROOM` | | Append | POST | `https://dj.su/api/rooms/ROOM/append`| | Clear | POST | `https://dj.su/api/rooms/ROOM/clear` | ```bash # Read (returns text/plain; empty body + 404 if room doesn't exist) curl https://raw.dj.su/ROOM # Replace entire content curl -X PUT "https://dj.su/api/rooms/ROOM" --data-binary @file.txt echo "hello" | curl -X PUT "https://dj.su/api/rooms/ROOM" --data-binary @- # Append (server inserts a newline before the new content if needed) date | curl -X POST "https://dj.su/api/rooms/ROOM/append" --data-binary @- # Clear (backs up to data-backup/ on the server) curl -X POST "https://dj.su/api/rooms/ROOM/clear" ``` - Writes: 10 MB max body. Empty PUT/append returns 400; use `/clear` to wipe. - Use `--data-binary` (not `-d`) to preserve newlines. - Writes are broadcast to connected browser clients in real time. - Concurrency: last-write-wins, no locking. ## Files | Action | Method | URL | Notes | |----------|--------|------------------------------------------------|------------------------------| | Upload | POST | `https://dj.su/api/rooms/ROOM/files` | filename in `X-Filename` hdr | | Download | GET | `https://dj.su/ROOM/FILENAME` | real name or returned slug | | Delete | DELETE | `https://dj.su/api/rooms/ROOM/files/FILENAME` | | ```bash curl -X POST "https://dj.su/api/rooms/ROOM/files" \ -H "X-Filename: myfile.txt" --data-binary @myfile.txt curl -O "https://dj.su/ROOM/myfile.txt" curl -X DELETE "https://dj.su/api/rooms/ROOM/files/myfile.txt" ``` - 5 GB max per file. Duplicate names get `(1)`, `(2)`, ... appended. - Upload response: `{"name":"...","size":N,"slug":"..."}`. Use either `name` or `slug` for the download URL.