Issue Comments

Commenting on an Issue

Issues can be commented on by any authenticated user.

POST /issues/<issue_id>/comments

Required Parameters

Optional Parameters

Example

$ curl -i \
       --header "Content-Type: application/json" \
       --data '{"comment": "Pothole getting larger every day"}' \
       https://seeclickfix.com/api/v2/issues/1/comments

Response

Status: 201 Created
{
  "moderated": false,
  "created_at": "2015-02-12T10:32:30-05:00",
  "updated_at": "2015-02-12T10:32:30-05:00",
  "comment": "Pothole getting larger every day",
  "body": "Pothole getting larger every day",
  "commenter": {
    "avatar": {
      "full": "http://seeclickfix.com/files/user_images/0001/3476/32eebb4f8669b5beb441280bc16f26bf.jpeg",
      "square_100x100": "http://seeclickfix.com/files/user_images/0001/3476/32eebb4f8669b5beb441280bc16f26bf_square.jpeg"
    },
    "civic_points": 10,
    "id": 1,
    "name": "Jeffb",
    "role": "Verified Official",
    "witty_title": "Street Smart"
  },
  "issue": {
    "status": "Acknowledged",
    "rating": 2
  },
  "media": {
    "video_url": "null",
    "image_full": "null",
    "image_square_100x100": "null"
  }
}

Example, with media

If you want to attach a image or video or both to your comment, you must use multipart form data not json. Here is an example including both:

$ curl -i \
       --header "Content-Type: multipart/form-data" \
       --data "comment=pools+are+nice" \
       --data "image=@photo.png" \
       --data "video=@video.mp4" \
       https://seeclickfix.com/api/v2/issues/1/comments

Response

Status: 201 Created
{
  "moderated": false,
  "comment": "pools are nice",
  "body": "pools are nice",
  "created_at": "2015-02-12T10:32:30-05:00",
  "updated_at": "2015-02-12T10:32:30-05:00",
  "commenter": {
    "avatar": {
      "full": "http://seeclickfix.com/files/user_images/0001/3476/32eebb4f8669b5beb441280bc16f26bf.jpeg",
      "square_100x100": "http://seeclickfix.com/files/user_images/0001/3476/32eebb4f8669b5beb441280bc16f26bf_square.jpeg"
    },
    "civic_points": 10,
    "id": 1,
    "name": "Jeffb",
    "role": "Verified Official",
    "witty_title": "Street Smart"
  },
  "issue": {
    "status": "Acknowledged",
    "rating": 2
  },
  "media": {
    "video_url": "null",
    "image_full": "http://seeclickfix.com/files/comment_images/0005/2789/sports.jpeg",
    "image_square_100x100": "http://seeclickfix.com/files/comment_images/0005/2789/sports.jpeg"
  }
}

Listing Comments on an Issue

Returns a collection of comment on the specified issue.

GET /issues/<issue_id>/comments

Order

Ordered by created date.

Example

$ curl -i https://seeclickfix.com/api/v2/issues/1/comments

Response

Status: 200 OK
{
  "comments": [
    {
      "comment": "Me too",
      "commenter": {
        "avatar": {
          "full": "http://seeclickfix.com/files/user_images/0001/3476/32eebb4f8669b5beb441280bc16f26bf.jpeg",
          "square_100x100": "http://seeclickfix.com/files/user_images/0001/3476/32eebb4f8669b5beb441280bc16f26bf_square.jpeg"
        },
        "civic_points": 10,
        "id": 1,
        "name": "Jeffb",
        "role": "Verified Official",
        "witty_title": "Street Smart"
      },
      "media": {
        "image_full": "http://seeclickfix.com/files/comment_images/0001/3476/32eebb4f8669b5beb441280bc16f26bf.jpeg",
        "image_square_100x100": "http://seeclickfix.com/files/comment_images/0001/3476/32eebb4f8669b5beb441280bc16f26bf_square.jpeg",
        "video_url": "http://www.youtube.com/watch?v=dQw4w9WgXcQ"
      },
      "flag_url": "https://seeclickfix.com/api/api/v2/comments/12345/flag",
      "created_at": "2011-04-14T16:00:49Z",
      "updated_at": "2011-04-14T16:00:49Z",
      "issue": {
        "rating": "18",
        "status": "Archived"
      }
    }
  ]
}

If for any reason we decide to hold the comment in moderation

We will finish processing the request at a later date.

Status: 202 Accepted
{
  "metadata": {
    "moderated": true
  }
}