Skip to content
shenfeng edited this page Apr 30, 2013 · 11 revisions

For all request except the login, add the access_token to the request header with key X-Token

People

POST /api/v1/login

  • email: user email,
  • password: user password

or

  • provider: like weibo, qq
  • id_in_provider: id
  • name: name in provider

=>

{
   id: 1,
   access_token: "sdfdsfsdfsdfsdf" // a random token 
}

Get user info /api/v1/users/:id

=>

{
    email: "[email protected]",
    qq: 386297760,
    interested_fields: "html5, bakcend, bigdata",
    work: "None",
    photo: "/user/pic/1212.jpg",
    follow: false
}

Get friends GET /api/v1/friends

=>

[{
    email: "[email protected]",
    qq: 386297760,
    interested_fields: "html5, bakcend, bigdata",
    work: "None",
    photo: "/user/pic/1212.jpg",
    follow: false
},
{
    email: "[email protected]",
    qq: 386297760,
    interested_fields: "html5, bakcend, bigdata",
    work: "None",
    photo: "/user/pic/1212.jpg",
    follow: false
},
]

Follow somebody POST /api/v1/follow

  • user_id: the user id to follow

Get events GET /api/v1/events/

  • start : start time, in milliseconds, default to 1 week ago.
  • end: end time, in milliseconds, default to now.
  • city: like beijing, Null means all.
[{
  id: 121321,
  title: "北京GDG之编程语言沙龙",
  start_time: "2013-05-05(周日),13:30"
  end_time: "2013-05-05(周日),17:00"
  location: "翠宫饭店,中国北京市海淀区知春路76号。10号线知春里D口,东行200米",
  detail: "如果你只会 Java、C 等一两种大众语言,那么你真的需要多了解一下外面的世界。...", 
  people: 1021
}]

People attend event GET /api/v1/events/:id/people

=>

[{
    email: "[email protected]",
    qq: 386297760,
    interested_fields: "html5, bakcend, bigdata",
    work: "None",
    photo: "/user/pic/1212.jpg",
    follow: false
}]

My events /api/v1/my-events