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" ]
}


Get question flagging settings

GET /settings/question-flagging

Response

{
  "enabled": false,
  "users": [
    {
        "location": "London",
        "image": "http://cdn.starmind.com:8080/static/user/default.jpg",
        "firstname": "Siger",
        "email": "siger.holmes@example.com",
        "is_deleted": false,
        "lastname": "Holmes",
        "id": 17309,
        "is_deleted": false,
        "customfields": { "occupation": "Detective" }
    }
  ]
}


Set question flagging settings

PUT /settings/question-flagging
Parameter Type Description
enabled boolean Whether question flagging is enabled or not.
users array List of users for who should be informed if a question is flagged.

Request

{
  "enabled": false,
  "users": [17309]
}

Response

{
  "enabled": false,
  "users": [
    {
        "location": "London",
        "image": "http://cdn.starmind.com:8080/static/user/default.jpg",
        "firstname": "Siger",
        "email": "siger.holmes@example.com",
        "is_deleted": false,
        "lastname": "Holmes",
        "id": 17309,
        "is_deleted": false,
        "customfields": { "occupation": "Detective" }
    }
  ]
}