Server Endpoints - Pancia/UniBull GitHub Wiki

Legend

varID => var identifier, currently just title or username

$x => get value of x

:sym => {sym : $sym}

Endpoint list

User Stuff:
√   POST - Authenticate 
        /user/login?:username&:password
        => userID
√   POST - SignUp
        /user/signup?:username&:password&:email
        => userID
√   POST - Log Out
        /user/:userID/logout
        => userID
√   POST - Join Class
        /user/:userID/joinClass?:classID
        => {:redirect, :classes}
    GET - Bookmarks
        /user/:userID/bookmarks?[:classID]
        => [#Bookmarks]
√   GET - Public User Info
        /user/:userID
        => {:username, :email, :classes, :threads, :replies}

Thread:
√   GET - All Threads
        /class/:classID/all
        => {:threads}
    GET - Thread, default mode is preview
        /class/:classID/thread/:threadID?mode=(preview|expanded|full)
        => [(Preview
    POST - Star Thread
        /class/:classID/thread/:threadID/star?:userID
        => ack
√   POST - Flag Thread
        /class/:classID/thread/:threadID/flag
        + {:msg, #TODO...}
        => ack
    POST - Endorse Thread
        /class/:classID/thread/:threadID/endorse?:userID
        => ack
    GET - Class Details
        /class/:classID/info
        => {:instructor, :TAs}
√   POST - Create Thread
        /class/:classID/submit
        + {:title, :content}
        => {:threads, :action}
    GET - Search Threads
        /class/:classID/search?#TODO...
        => [#Thread]
√   PUT - Edit Thread
        /class/:classID/thread/:threadID/edit
        + #Thread
        => {:thread}
√   DELETE - Delete Thread
        /class/:classID/thread/:threadID/delete
        => ack

Classes:
√   GET - Get all Classes
        /class/
        => {:classes}
    GET - Search Classes
        /class/search?#TODO...
        => [#Class] #TODO maybe #MinClass
√   POST - Create Class
        /class/create
        + {:title, :info, :school}
        => {:class, :redirect}

Reply:
    GET - All Replies
        /class/:classID/thread/:threadID/all
        => {:replies}
    POST - Star Reply
        /class/:classID/thread/:threadID/reply/:replyID/star?:userID
        => ack
√   POST - Flag Reply
        /class/:classID/thread/:threadID/reply/:replyID/flag
    GET - Thread Info #TODO why is this necessary?
        /class/:classID/thread/:threadID
        => Thread
√   POST - Reply To
        /class/:classID/thread/:threadID/reply
        /class/:classID/thread/:threadID/reply/:replyID/reply
        => {:replies, :action}
    POST - Endorse Reply
        /class/:classID/thread/:threadID/reply/:replyID/endorse?:userID
        => ack
√   PUT - Edit Reply
        /class/:classID/thread/:threadID/reply/:replyID/edit
        + #Reply
        => {:reply}
√   DELETE - Delete Reply
        /class/:classID/thread/:threadID/reply/:replyID/delete
        => ack

Class Resources:
    GET - Get All Resources
        /class/:classID/resources
        => [#Resources]
    POST - Upload File
        /class/:classID/resources/upload?#TODO...
        + {#File}
        => ack