Time format is the ISO 8601 UTC format. For example, "2015-11-09T09:59:15Z"
Return the list of all registered users objects.
To get the complete user details, see GET /api/v1.0/users/:user-id
.
GET /api/v1.0/users
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"_id": "user id",
"name": "user name",
"email": "[email protected]",
"avatarUrl: "http://link/to/avatr.jpeg",
"createTime": "2015-11-09T09:59:15Z",
"facebookId": "facebook-id",
}
]
Return a user object.
GET /api/v1.0/users/:user-id
HTTP/1.1 200 OK
Content-Type: application/json
{
"_id": "user id",
"name": "user name",
"email": "[email protected]",
"avatarUrl: "http://link/to/avatr.jpeg",
"createTime": "2015-11-09T09:59:15Z",
"facebookId": "facebook-id",
"facebookAccessToken": "facebook-access-token"
}
Register a user with facebook account, and return the user id.
If a user with the input facebook-id
does not exists, a new user object is created.
POST /api/v1.0/users/register
Content-Type: application/json
{
"name": "user name"
"email": "[email protected]"
"avatarUrl": "http://link/to/avatr.jpeg",
"facebookId": "facebook-id",
"facebookAccessToken": "facebook-access-token"
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"_id": "user id"
}
Return the user Asks feed. The Asks feed if the list of all Asks where:
-
The Ask object status is
active
. -
The user Ask object status does not exists (the user ask status of
skipped
,follow
, orarchived
was not set).
GET /api/v1.0/users/:user-id/feed
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"_id": "ask-id",
"user": {
"_id": "user id",
"name": "user name",
"avatarUrl: "http://link/to/avatr.jpeg",
},
"createTime": "2015-11-09T09:59:15Z",
"content": "The ask content",
"isAnonymous": "true | false"
}
]
Post a new Ask object.
POST /api/v1.0/users/:user-id/asks
Content-Type: application/json
{
"content": "The ask content",
"isAnonymous": "true | false"
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"_id": "ask-id",
}
Return the user Ask objects with the input status.
ask-status
can be one of followed
, skipped
, or archived
.
GET /api/v1.0/users/:user-id/ask-status
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"_id": "ask-id",
"user": {
"_id": "user id",
"name": "user name",
"avatarUrl: "http://link/to/avatr.jpeg",
},
"createTime": "2015-11-09T09:59:15Z",
"content": "The ask content",
"isAnonymous": "true | false"
}
]
Update a user ask status.
PUT /api/v1.0/users/:id/asks/:askid
Content-Type: application/json
{
"status": "skipped | followed | archived",
"muted": "true | false"
}
HTTP/1.1 200 OK
Content-Type: application/json