Comment PUT Resource

Update a Comment

PUT /comments/:id
Parameter Type Description
description string (HTML + mentioning markup) The comment itself.

Payload

{
    "description": "Elementary, dear Watson."
}

Response

In case of a successful update, the response contains the updated comment.

{
    "id": 7,
    "description": "Elementary, my dear Watson.",
    "user": "/users/42",
    "created": "2013-12-13T16:45:13.000Z",
    "updated": "2013-12-13T16:45:13.000Z",
    "content_updated": "2013-12-13T16:45:13.000Z",
    "question": "/questions/42",
    "solution_id": null,
    "is_deleted": false,
    "promoted_solution": null,
    "upvote_count": 21
}

Promote a Comment to a Solution

PUT /comments/:id/promote

Response

In case of a successful promotion, the response contains the updated comment.

Note: Comments by the question author may not be promoted.

{
    "id": 7,
    "description": "Elementary, my dear Watson.",
    "user": "/users/42",
    "created": "2013-12-13T16:45:13.000Z",
    "updated": "2013-12-14T16:45:13.000Z",
    "content_updated": "2013-12-14T16:45:13.000Z",
    "question": "/questions/42",
    "solution_id": null,
    "is_deleted": false,
    "promoted_solution": 42,
    "upvote_count": 21
}