Answers

Answers are user submitted responses to questions.

List answers to a question.

GET https://seeclickfix.com/api/v2/questions/<question_id>/answers

Optional Parameters

None.

Examples

$ curl -i https://seeclickfix.com/api/v2/questions/1/answers

Returns all answers to question id 1.

Status: 200 OK
{
  "answers": [
    {
      "accepted_at": null,
      "answer": "Pretty sure it's ok to keep chickens",
      "answerer": {
        "avatar": {
          "full": "http://seeclickfix.com/assets/no-avatar-100.png",
          "square_100x100": "http://seeclickfix.com/assets/no-avatar-100.png"
        },
        "civic_points": 100,
        "id": 10,
        "name": "Mike Helpless",
        "role": "Verified Official",
        "witty_title": "Street Smart"
      },
      "created_at": "2013-05-14T19:49:13-04:00",
      "id": 4,
      "locale": null,
      "question_id": 2,
      "total_votes": 15,
      "updated_at": "2013-05-14T19:49:13-04:00"
    }
  ],
  "errors": {

  },
  "metadata": {

  }
}

Answer a Question

POST https://seeclickfix.com/api/v2/questions/1/answers

Posts an answer to question id 1.

Required Parameters

Optional Parameters

Examples

$ curl --data "answer=Taxes+are+due+Jan.+1st." -i https://seeclickfix.com/api/v2/questions/1/answers
Status: 201 Created
{
  "accepted_at": null,
  "answer": "Pretty sure it's ok to keep chickens",
  "answerer": {
    "avatar": {
      "full": "http://seeclickfix.com/assets/no-avatar-100.png",
      "square_100x100": "http://seeclickfix.com/assets/no-avatar-100.png"
    },
    "civic_points": 100,
    "id": 10,
    "name": "Mike Helpless",
    "role": "Verified Official",
    "witty_title": "Street Smart"
  },
  "created_at": "2013-05-14T19:49:13-04:00",
  "id": 4,
  "locale": null,
  "question_id": 2,
  "total_votes": 15,
  "updated_at": "2013-05-14T19:49:13-04:00"
}

Errors

Returns error code 422 if unable to create user.

Status: 422 Unprocessable Entity
{
  "errors": {
    "login": "can't be blank."
  }
}