Skip to content
siuying edited this page Oct 13, 2012 · 11 revisions

Items

GET /user/:id.json

Get user data

Example

{
  "id": 1,
  "name": "",
  "followers_count": 0,
  "created_at": "2012-10-11T17:32:14Z",
  "updated_at": "2012-10-11T17:32:14Z",
  "avatar_url": "http://placekitten.com/200/200"
}

GET /items.json

List all items.

Sample

{
    "id": 8,
    "title": "MacBook Pro ",
    "desc": "Not mine but free to buy it",
    "price": "1.0",
    "address": null,
    "latitude": 22.2859724778506,
    "longitude": 114.190312663862,
    "photos": [
      {
        "small": "http://a4.res.cloudinary.com/hvwz5zxen/image/upload/c_thumb,h_300,w_300/v1350063285/krmcesena8c4vp76jhue.jpg",
        "medium": "http://a4.res.cloudinary.com/hvwz5zxen/image/upload/c_thumb,h_600,w_600/v1350063285/krmcesena8c4vp76jhue.jpg",
        "large": "http://a4.res.cloudinary.com/hvwz5zxen/image/upload/c_fit,h_1200,w_1200/v1350063285/krmcesena8c4vp76jhue.jpg"
      }
    ]
  },
  {
    "id": 9,
    "title": "123",
    "desc": "Totally interesting stuff , must buy",
    "price": "12.0",
    "address": null,
    "latitude": 22.2860473924616,
    "longitude": 114.190386476955,
    "photos": [
      {
        "small": "http://a4.res.cloudinary.com/hvwz5zxen/image/upload/c_thumb,h_300,w_300/v1350095273/rzfh5oirulushoc2axag.jpg",
        "medium": "http://a4.res.cloudinary.com/hvwz5zxen/image/upload/c_thumb,h_600,w_600/v1350095273/rzfh5oirulushoc2axag.jpg",
        "large": "http://a4.res.cloudinary.com/hvwz5zxen/image/upload/c_fit,h_1200,w_1200/v1350095273/rzfh5oirulushoc2axag.jpg"
      }
    ]
  }
]

GET /items/nearby.json

Search nearby items.

Parameters

  • lat - latitue
  • lon - longtitude
  • distance - the radius of items

Sample

[
{
    "id": 8,
    "title": "MacBook Pro ",
    "desc": "Not mine but free to buy it",
    "price": "1.0",
    "address": null,
    "latitude": 22.2859724778506,
    "longitude": 114.190312663862,
    "photos": [
      {
        "small": "http://a4.res.cloudinary.com/hvwz5zxen/image/upload/c_thumb,h_300,w_300/v1350063285/krmcesena8c4vp76jhue.jpg",
        "medium": "http://a4.res.cloudinary.com/hvwz5zxen/image/upload/c_thumb,h_600,w_600/v1350063285/krmcesena8c4vp76jhue.jpg",
        "large": "http://a4.res.cloudinary.com/hvwz5zxen/image/upload/c_fit,h_1200,w_1200/v1350063285/krmcesena8c4vp76jhue.jpg"
      }
    ]
  },
  {
    "id": 9,
    "title": "123",
    "desc": "Totally interesting stuff , must buy",
    "price": "12.0",
    "address": null,
    "latitude": 22.2860473924616,
    "longitude": 114.190386476955,
    "photos": [
      {
        "small": "http://a4.res.cloudinary.com/hvwz5zxen/image/upload/c_thumb,h_300,w_300/v1350095273/rzfh5oirulushoc2axag.jpg",
        "medium": "http://a4.res.cloudinary.com/hvwz5zxen/image/upload/c_thumb,h_600,w_600/v1350095273/rzfh5oirulushoc2axag.jpg",
        "large": "http://a4.res.cloudinary.com/hvwz5zxen/image/upload/c_fit,h_1200,w_1200/v1350095273/rzfh5oirulushoc2axag.jpg"
      }
    ]
  }
]

POST /items/create

Create a new item. (required user login)

Parameters

  • item - object of item, to be inserted

Returns

Returns created item, or 422 unprocessable entity.

Clone this wiki locally