Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REST APIs #15

Open
psitronic opened this issue Dec 23, 2018 · 1 comment
Open

REST APIs #15

psitronic opened this issue Dec 23, 2018 · 1 comment

Comments

@psitronic
Copy link
Contributor

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
}
  1. 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
Copy link
Contributor

Great stuff @psitronic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants