fix dlen
[citadel.git] / webcit-ng / api.txt
index 5336667486fea79312d0878b526cec50267c2860..8660c8f2ca7d20f17fc0a243d90e3247993fb963 100644 (file)
@@ -1,7 +1,9 @@
 Method          URL                                Function
 ------          ------------------------------     -------------------------------------
 GET             /                                  Site root will redirect to a landing page
+
 GET             /ctdl/f/                           returns a JSON-encoded list of accessible floors
+
 GET             /ctdl/r/                           returns a JSON-encoded list of accessible rooms
 OPTIONS         /ctdl/r/<roomname>/                returns just what you'd expect
 PROPFIND        /ctdl/r/<roomname>/                Show a bunch of crap
@@ -14,12 +16,12 @@ GET             /ctdl/r/<roomname>/stat            JSON dictionary of the server
 GET             /ctdl/r/<roomname>/<msgnum>        Retrieve the content of an individual message
 GET             /ctdl/r/<roomname>/<msgnum>/json   Retrieve an individual message in a room, encapsulated in JSON
 GET             /ctdl/r/<roomname>/<msgnum>/<part> Retrieve a MIME component of a message, specified by partnum
-DELETE          /ctdl/r/<roomname>/<msgnum>        Deletes a message from a room
-MOVE            /ctdl/r/<roomname>/<msgnum>        Moves a message to another room (requires Destination)
+DELETE          /ctdl/r/<roomname>/<msgnum>        Delete a message from a room
+MOVE            /ctdl/r/<roomname>/<msgnum>        Move a message to another room (requires Destination)
 
 PUT             /ctdl/r/<roomname>/<xxx>           DAV operation to insert a new message into a room
                 Accepted parameters:
-                wefw List of message references
+                wefw List of message references, separated by "!" delimiter
                 subj Message subject
                 The returned ETag will be the new message number.
 
@@ -31,7 +33,20 @@ GET             /ctdl/c/info                       Returns a JSON representation
 POST            /ctdl/a/login                      Send it a your credentials and it will log you in
 GET             /ctdl/a/whoami
 GET             /ctdl/a/biff                       Check for new mail
-POST            /ctdl/a/upload                     Handler for uploading attachments and other file items
 GET             /ctdl/u/<username>/userpic         Returns an image containing the photo/avatar of the specified user
 GET             /ctdl/s/                           Static content (html, css, js, images...)
 GET             /.well-known/                      Static content (RFC5785 compliant paths)
+POST            /ctdl/p                            Handler for uploading attachments and other file items
+                                                   The JSON returned wil contain one or more uploads in an array like this:
+                                                   [
+                                                     {
+                                                       "uploadfilename" : "Track 01.wav",
+                                                       "contenttype" : "audio/wav",
+                                                       "ref" : "cdarzowkk",
+                                                       "contentlength" : 56222252
+                                                     }
+                                                   ]
+GET             /ctdl/p/<ref>                      Fetch a specific item that was uploaded ("ref" was returned by the upload)
+DELETE          /ctdl/p/<ref>                      Delete a specific item that was uploaded ("ref" was returned by the upload)
+GET             /ctdl/p/<msgnum>                   Load the attachments from message <msgnum> in, as if they were uploaded
+                                                   by the client.  Returns the same JSON as "POST /ctdl/p".