Get answer by id.
URL: /questions/:questionId/answers/:answerId
Method: GET
URL parameters: questionId=[integer]
, answerId=[integer]
where questionId
and answerId
are mongoose object id syntax.
Code: 200 OK
Return specific answer.
{
"author": "Brian McKenzie",
"id": "ce7bddfb-0544-4b14-92d8-188b03c41ee4",
"summary": "The Earth is flat."
}
Code: 400 BAD REQUEST
Condition: If question with provided id doesn't exist.
{
"err": "question with such id doesn't exist",
"fail": true
}
Code: 400 BAD REQUEST
Condition: If answer with provided id doesn't exist.
{
"err": "answer with such id doesn't exist",
"fail": true
}
Code: 400 BAD REQUEST
Condition: If provided id's are invalid.
{
"err": "Provided id's doesn't match uuidv4 pattern",
"fail": true
}