Question Flagging

Question flagging is a feature which, when enabled, allows users to flag questions they find inappropriate. Flagging a question for the first time triggers a notification to a configured list of users. If a question is flagged by three individual users, a notification is triggered as well and the question is automatically deleted. Users cannot flag their own questions (they should edit or delete them instead).



Get question flagged status

GET /questions/:id/flag


Returns whether or not current user has flagged the question at least once. If the current user specified a message, explaining why the question is inappropriate, then this message, along with previous messages by the same user, will be returned as messages array, otherwise messages will be empty.

Response

{
  "flagged": true,
  "messages": [ "This question is inappropriate" ]
}


Flag question

PUT /questions/:id/flag

Allows to flag a question as inappropriate. An optional message can be provided, explaining why the question is considered inappropriate. The provided message, along with previous messages by the same user, will be returned as messages array. If no messages are available, the array will be empty.

Parameter Type Default Required Description
message string - An optional message explaining why the question is inappropriate.

Request


{
  "message": "This question is inappropriate"
}

Response

{
  "flagged": true,
  "messages": [ "This question is inappropriate" ]
}