=========================
Get Comments on Diff Line
=========================

:Path: ``api/json/reviewrequests/{review_request_id}/diff/{diff_revision}/file/{filediff_id}/line/{linenum}/comments/``


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

+-------------------+---------+-------------------------------------+
| Parameter         | Type    | Description                         |
+===================+=========+=====================================+
| review_request_id | Integer | The ID of the review request.       |
+-------------------+---------+-------------------------------------+
| diff_revision     | Integer | The revision of the diff.           |
+-------------------+---------+-------------------------------------+
| filediff_id       | Integer | The ID of the FileDiff_ containing  |
|                   |         | the comments.                       |
+-------------------+---------+-------------------------------------+
| linenum           | Integer | The line number containing the      |
|                   |         | comments.                           |
+-------------------+---------+-------------------------------------+

.. _FileDiff: ../../datatypes/filediff


HTTP GET
========

Returns the list of comments on a particular line of a diff.

The comments may span one or more lines, and may belong to different
reviews.

These may include draft comments made by the requesting user.


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

.. code-block:: none

    GET /api/json/reviewrequests/12321/diff/1/file/9456/line/42/comments/


Responses
---------

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

+----------+-------------------+------------------------------+
| Field    | Type              | Description                  |
+==========+===================+==============================+
| comments | Array of Comment_ | The list of comments.        |
+----------+-------------------+------------------------------+

.. _Comment: ../../datatypes/comment


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

.. code-block:: javascript

    {
      stat: "ok",
      comments: [
        {
          id: 25,
          filediff: {
            id: 9456,
            diffset: {
              id: 54,
              name: "bugfix-1.diff",
              revision: 1,
              timestamp: "2010-01-12 09:56:19",
              repository: {
                path: "git://github.com/reviewboard/reviewboard.git",
                tool: "Git",
                id: 1,
                name: "Review Board"
              }
            },
            source_file: "README",
            dest_file: "README",
            source_revision: "123",
            dest_revision: "456",
          },
          interfilediff: null,
          text: "This is a sample comment",
          timestamp: "2010-01-14 12:05:43",
          timesince: "6 days ago",
          first_line: 42,
          num_lines: 2,
          public: 1,
          user: {
            username: "joe",
            first_name: "Joe",
            last_name: "User",
            url: "/users/joe/",
            email: "joe@example.com",
            fullname: "Joe User",
            id: 1
          }
        }
      ]
    }


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

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

The client making the request is not logged in and the server disallows
anonymous access.

See :ref:`authenticating` for more information.


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

There are two possibilities for this error:

* The review request with the given ``review_request_id`` does not exist on the
  server.
* The ``filediff_id`` is invalid or isn't owned by the review request.


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