chingu-voyage7 / Bears-Team-17

CarTalk - A community designed for car enthusiasts | Voyage-7 | https://chingu.io/
5 stars 0 forks source link

REST APIs #15

Open psitronic opened 5 years ago

psitronic commented 5 years ago

Currently implemented APIs:

  1. to post a question: /api/question with the body parameter question: {"messageText":String,"messageTitle":String,"messageTags":Array,"messageAuthor":ObjectID} Returns:
    • if posted successfully:
      {
      "success": true,
      "message": "Question posted",
      "question": {...}
      }
    • if unsuccessfully:
      {
      "success": false,
      "message": error
      }
  2. to get questions: /api/question /api/question?sortby=date /api/question?sortby=date&order=1 /api/question?sortby=date&order=-1 The parameter sortby can take values date, views, scores, and n_answers; order is either 1 or -1. Default values are date and -1 respectively. Returns an array of objects or error
Francis-Njoku commented 5 years ago

Great stuff @psitronic