Solution PUT Resources

Update a solution

PUT /solutions/:id
{
    "description": "<p>There are some reports about him traveling through Europe, but they're not very credible.</p>"
}
Parameter Type Description
description string (HTML + mentioning markup) Unlimited length.
validity_period string If solution validation is enabled, must be one of days_one, weeks_one, months_one, months_three, months_six, years_one, open. If solution validation is disabled, this value is ignored.

Updates can be done partially. The response will be the full and updated resource.

Solutions can only be edited by the author and admins.

Response

{
    "id": 55,
    "is_published": true,
    "published": "2015-02-02T11:36:05.000Z",
    "rating": 4.5,
    "rating_count": 4,
    "description": "<p>There are some reports about him traveling through Europe.</p>",
    "user": "/users/97",
    "is_deleted": false,
    "created": "2013-12-13T16:40:21.000Z",
    "updated": "2013-12-13T16:42:22.000Z",
    "content_updated": "2013-12-13T16:42:22.000Z",
    "question": "/questions/47",
    "attachments": "/solutions/55/attachments",
    "validity_period": null,
    "expires": null,
    "upvote_count": 2,
    "accepted_by_question_poser": "2014-04-02T15:42:41.000Z"
}

Publish a solution

PUT /solutions/:id/publish

This request does not have a body, and in case of success, a HTTP 200 OK without body will be sent.

Restore a solution

PUT /solutions/:ID/restore

This request does not have a body, and in case of success, a HTTP 200 OK without body will be sent.

Requires the role content_admin. Only deleted solutions can be restored. A deleted solution can always be restored, independent of wether the question it belongs to is deleted or not.