Users

Show Current User

GET https://seeclickfix.com/api/v2/profile

Returns the currently logged in user.

Example

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

If the user is logged in.

Status: 200 OK
{
  "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,
  "closed_issue_count": 27,
  "comments_count": 62,
  "created_at": "2011-03-22T17:04:31-04:00",
  "following_issue_count": 10,
  "id": 1,
  "name": "captainkickstand",
  "permissions": {
    "can_acknowledge": false
  },
  "reported_issue_count": 25,
  "updated_at": "2014-03-10T07:28:35-04:00",
  "voted_issue_count": 31,
  "witty_title": "Street Smart"
}

If the user is not logged in.

Status: 200 OK
{
  "id": null
}

Show User by Id

GET https://seeclickfix.com/api/v2/users/:id

Returns a single user by :id.

Examples

$ curl -i https://seeclickfix.com/api/v2/users/1
Status: 200 OK
{
  "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,
  "closed_issue_count": 27,
  "comments_count": 62,
  "created_at": "2011-03-22T17:04:31-04:00",
  "following_issue_count": 10,
  "id": 1,
  "name": "captainkickstand",
  "permissions": {
    "can_acknowledge": false
  },
  "reported_issue_count": 25,
  "updated_at": "2014-03-10T07:28:35-04:00",
  "voted_issue_count": 31,
  "witty_title": "Street Smart"
}

Errors

Returns error code 404 if no results are found.

Status: 404 Not Found

List Users

GET https://seeclickfix.com/api/v2/users

Returns a list of users closest to point.

Required Parameters

Optional Parameters

Order

The sort order is by distance from Point.

Examples

$ curl -i https://seeclickfix.com/api/v2/users?address=New+Haven,+CT

Returns the 20 closest users.

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"
    }
  },
  "users": [
    {
      "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,
      "closed_issue_count": 27,
      "comments_count": 62,
      "created_at": "2011-03-22T17:04:31-04:00",
      "following_issue_count": 10,
      "id": 1,
      "name": "captainkickstand",
      "permissions": {
        "can_acknowledge": false
      },
      "reported_issue_count": 25,
      "updated_at": "2014-03-10T07:28:35-04:00",
      "voted_issue_count": 31,
      "witty_title": "Street Smart"
    }
  ]
}

Errors

Returns error code 400 if a point is not specified

Status: 400 Bad Request
{
  "message": "Point missing from request.",
  "documentation_url": "http://dev.seeclickfix.com"
}

Register

POST https://seeclickfix.com/api/v2/users

Registers a new user

Required Parameters

Optional Parameters

Examples

$ curl -i https://seeclickfix.com/api/v2/users
Status: 201 Created
{
  "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,
  "closed_issue_count": 27,
  "comments_count": 62,
  "created_at": "2011-03-22T17:04:31-04:00",
  "following_issue_count": 10,
  "id": 1,
  "name": "captainkickstand",
  "permissions": {
    "can_acknowledge": false
  },
  "reported_issue_count": 25,
  "updated_at": "2014-03-10T07:28:35-04:00",
  "voted_issue_count": 31,
  "witty_title": "Street Smart"
}

Errors

Returns error code 422 if unable to create user.

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

Update User Settings

PUT https://seeclickfix.com/api/v2/profile

Updates the settings for the current user.

Required Parameters

Optional Parameters

Examples

$ curl -i https://seeclickfix.com/api/v2/profile
Status: 200 OK
{
  "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,
  "closed_issue_count": 27,
  "comments_count": 62,
  "created_at": "2011-03-22T17:04:31-04:00",
  "following_issue_count": 10,
  "id": 1,
  "name": "captainkickstand",
  "permissions": {
    "can_acknowledge": false
  },
  "reported_issue_count": 25,
  "updated_at": "2014-03-10T07:28:35-04:00",
  "voted_issue_count": 31,
  "witty_title": "Street Smart"
}

Errors

Returns error code 422 if unable to update the user.

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