Questions

Questions and answers are only available in places where the data_classification is of type “City”.

List questions

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

Optional Parameters

Order

The default sort order is by popularity.

Examples

$ curl -i https://seeclickfix.com/api/v2/new-haven/questions

Returns questions asked within the city of New Haven, CT, where the place_url is ‘new-haven’.

Status: 200 OK
{
  "errors": {

  },
  "metadata": {
    "pagination": {
      "next_page": 2,
      "next_page_url": "https://seeclickfix.com/api/api/v2/<ENDPOINT>?page=2",
      "page": 1,
      "pages": 40457,
      "per_page": 20,
      "previous_page": "null",
      "previous_page_url": "null"
    }
  },
  "questions": [
    {
      "asker": {
        "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"
      },
      "created_at": "2013-05-14T19:49:13-04:00",
      "id": 1,
      "locale": "en",
      "question": "Is it legal to bike on the sidewalk?",
      "updated_at": "2013-05-14T19:49:13-04:00"
    }
  ]
}

Get a single question

GET /questions/:id

Returns a single question by id.

Example

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

Response

Status: 200 OK
{
  "asker": {
    "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"
  },
  "created_at": "2013-05-14T19:49:13-04:00",
  "id": 1,
  "locale": "en",
  "question": "Is it legal to bike on the sidewalk?",
  "updated_at": "2013-05-14T19:49:13-04:00"
}

Errors

If a question with the specified id is not found a response code 404 will be returned.

Status: 404 Not Found

Ask a Question

POST https://seeclickfix.com/api/v2/:place_url_name/questions

Posts a question within city of :place_url_name.

Required Parameters

Optional Parameters

Examples

$ curl --data "question=When+are+taxes+due?" -i https://seeclickfix.com/api/v2/new-haven/questions
Status: 201 Created
{
  "asker": {
    "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"
  },
  "created_at": "2013-05-14T19:49:13-04:00",
  "id": 1,
  "locale": "en",
  "question": "Is it legal to bike on the sidewalk?",
  "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."
  }
}