Skip to content
Shan edited this page Jul 30, 2014 · 3 revisions

REST API Calls


Home page

URI: /
METHOD: GET
PARAMS: n/a
DESC: get all cards sorted by latest date
CONTROLLER: controllers.Application.index


CARDS

URI: /cards
METHOD: GET
PARAMS:

  • sortBy: Date|Receiver
  • sortDir: ASC|DESC
  • user: [user_name]

DESC: get all cards with given parameters, sorted by date by default
CONTROLLER: controllers.CardController.getCards

URI: /card/[card_ID]
METHOD: GET
PARAMS: n/a
DESC: get card by ID
CONTROLLER: controllers.CardController.getCard(id: Int)
RESPONSE:

{ }

URI: /card/[card_ID]/comments
METHOD: GET
PARAMS: n/a
DESC: get comments of a card
CONTROLLER: controllers.CardController.getCardComments(id: Int)

URI: /card
METHOD: PUT
PARAMS:
{ "recipients" : ["firstname.lastname"], "message" : "kudo message", "senders" : ["firstname.lastname"] }
DESC: get comments of a card
CONTROLLER: controllers.CardController.addCard

URI: /card/[card_ID]
METHOD: DELETE
PARAMS: n/a
DESC: delete a card
CONTROLLER: controllers.CardController.deleteCard(id: Int)


COMMENTS

URI: /comment/[comment_ID]
METHOD: GET
PARAMS: n/a
DESC: get the content of a specific comment
CONTROLLER: controllers.CommentController.get(id: Int)

URI: /comment/[card_ID]
METHOD: GET
PARAMS: n/a
DESC: get the comments of a given card
CONTROLLER: controllers.CommentController.add(card_id: Int)


USERS

URI: /user/[user_name]
METHOD: GET
PARAMS: n/a
DESC: get the profile of a user
CONTROLLER: controllers.UserController.getUser(username: String)

URI: /users
METHOD: GET
PARAMS: n/a
DESC: get the profiles of all users
CONTROLLER: controllers.DirectoryController.getAll

URI: /users/[first_name][/[last_name]]
METHOD: GET
PARAMS: n/a
DESC: get the profiles of all users matching the name
CONTROLLER: controllers.UserController.getUsers(firstNamePrefix: String, lastNamePrefix = "")

URI: /users/ldapSync
METHOD: POST
PARAMS: n/a
DESC: update user database with latest LDAP users
CONTROLLER: controllers.UserController.ldapSync


AUTHORIZATION

URI: /login
METHOD: POST
PARAMS:
{ "username" : "firstname.lastname", "password" : "password" }
DESC: authenticate a user
CONTROLLER: controllers.AuthController.login

URI: /logout
METHOD: POST
PARAMS:
{ "username" : "firstname.lastname", "password" : "password" }
DESC: authenticate a user
CONTROLLER: controllers.AuthController.logout


EMAIL NOTIFICATION

URI: /email/sendto/[email]
METHOD: POST
PARAMS: n/a
DESC: send email to an email address
CONTROLLER: controllers.DirectoryController.sendNotification(email: String)


DDL

URI: /directory
METHOD: GET
PARAMS: n/a
DESC: n/a
CONTROLLER: controllers.DirectoryController.getAll

URI: /directory/email/[email]
METHOD: GET
PARAMS: n/a
DESC: n/a
CONTROLLER: controllers.DirectoryController.searchEmail(email: String)

URI: /ddl
METHOD: GET
PARAMS: n/a
DESC: n/a
CONTROLLER: controllers.DDL.initDb


Map static resources from the /public folder to the /assets URL path

GET ~~~ ~~~ /assets/*file ~~~ ~~~ ~~~ ~~~ ~~~ controllers.Assets.at(path="/public", file)