=========================
Set and Save Review Draft
=========================

:Path: ``api/json/reviewrequests/{review_request_id}/reviews/draft/save/``


URL Parameters
==============

+-------------------+---------+-------------------------------------+
| Parameter         | Type    | Description                         |
+===================+=========+=====================================+
| review_request_id | Integer | The ID of the review request.       |
+-------------------+---------+-------------------------------------+


HTTP POST
=========

Sets fields in the draft review and saves the draft.

This will create a new draft if one doesn't already exist.

All fields are optional in a request, but at least one should be specified
in order for this call to do anything.


Request Parameters
------------------

+-------------+---------+--------------------------------------------------+
| Parameter   | Type    | Description                                      |
+=============+=========+==================================================+
| shipit      | Boolean | Whether or not the review should be marked       |
|             |         | "ship it!"                                       |
+-------------+---------+--------------------------------------------------+
| body_top    | String  | The body text preceeding the comments.           |
+-------------+---------+--------------------------------------------------+
| body_bottom | String  | The body text following the comments.            |
+-------------+---------+--------------------------------------------------+


Example Request
---------------

.. code-block:: none

    POST /api/json/reviewrequests/12321/reviews/draft/save/
    shipit=1


Responses
---------

HTTP 200: Success
~~~~~~~~~~~~~~~~~

The draft saved successfully.


Example Response
^^^^^^^^^^^^^^^^

.. code-block:: javascript

    {
      stat: "ok",
    }


HTTP 401: Unauthorized
~~~~~~~~~~~~~~~~~~~~~~

Error 103: Not Logged In
^^^^^^^^^^^^^^^^^^^^^^^^

The client making the request is not logged in.

See :ref:`authenticating` for more information.


HTTP 404: Not Found
~~~~~~~~~~~~~~~~~~~

The review request with the given ``review_request_id`` does not exist on the
server.


.. comment: vim: ft=rst et ts=3
