-
Notifications
You must be signed in to change notification settings - Fork 0
WebAPI
Combord edited this page Mar 23, 2015
·
13 revisions
## Authentication
### Facebook
## Coach
### Coach object:
```
{
"userId": *ObjectId*,
"subject": *String*,
"description": *String*,
"createdAt": *Date*,
"updatedAt": *Date*,
"id": *ObjectId*
}
```
### getAllCoach
### getCoachById
### createCoach
### updateCoach
### deleteCoach
### getCoachBySearch
## User
### User object:
```
{
"id": *ObjectId*,
"name": *String*,
"email": *email*,
"passports": *Passport*,
"createdAt": *Date*,
"updatedAt": *Date*,
"deletedAt": *Date*
}
```
### getAllUser
### getUserById
### createUser
### updateUser
### deleteUser
### getUserBySearch
## Circle
### Circle object:
```
{
"id": *ObjectId*,
"name": *String*,
"creatorId": *ObjectId*,
"createdAt": *Date*,
"updatedAt": *Date*,
"deletedAt": *Date*
}
```
### getAllCircle
### getCircleById
### createCircle
### updateCircle
### deleteCircle
### getCircleBySearch
Request:
/auth/facebook-token/token
POST params:
access_token: [TOKEN]
Response:
{
"isSuccess": true,
"error": "",
"user": [ *authedUser* ]
}
Request:
/webapi/coach/getAllCoach
POST params:
null
Response:
{
"isSuccess": true,
"error": "",
"coaches": [ *coaches* ]
}
Request:
/webapi/coach/getCoachById
POST params:
id : (ObjectId)
Response:
{
"isSuccess": true,
"error": "",
"coach": *coach*
}
Request:
/webapi/coach/createCoach
POST params:
subject : (String)(required)
description : (String)
Response:
{
"isSuccess": true,
"error": "",
"coach": *coach*
}
Request:
/webapi/coach/updateCoach
POST params:
id : (String)(required)
subject : (String)
description : (String)
Response:
{
"isSuccess": true,
"error": "",
"coach": *coach*
}
Request:
/webapi/coach/deleteCoach
POST params:
id : (String)(required)
Response:
{
"isSuccess": true,
"error": "",
"coach": *coach*
}
Request:
/webapi/coach/getCoachBySearch
POST params:
search : (String)(required) (query string on subjects)
Response:
{
"isSuccess": true,
"error": "",
"coaches": [*coaches*]
}
Request:
/webapi/user/getAllUser
POST params:
null
Response:
{
"isSuccess": true,
"error": "",
"users": [ *users* ]
}
Request:
/webapi/user/getUserById
POST params:
id : (ObjectId)
Response:
{
"isSuccess": true,
"error": "",
"user": *user*
}
Request:
/webapi/user/createUser
POST params:
name : (String)
email : (String)
Response:
{
"isSuccess": true,
"error": "",
"user": *user*
}
Request:
/webapi/user/updateUser
POST params:
id : (String)(required)
name : (String)
email : (String)
Response:
{
"isSuccess": true,
"error": "",
"user": *user*
}
Request:
/webapi/user/deleteUser
POST params:
id : (String)(required)
Response:
{
"isSuccess": true,
"error": "",
"user": *user*
}
Request:
/webapi/user/getUserBySearch
POST params: !!!(the query require at least one parameter)!!!
name : (String)(query string on names)
email: (String)(query string on emails)
Response:
{
"isSuccess": true,
"error": "",
"users": [*users*]
}
Request:
/webapi/circle/getAllCircle
POST params:
null
Response:
{
"isSuccess": true,
"error": "",
"circles": [ *circles* ]
}
Request:
/webapi/circle/getCircleById
POST params:
id : (ObjectId)
Response:
{
"isSuccess": true,
"error": "",
"circle": *circle*
}
Request:
/webapi/circle/createCircle
POST params:
name : (String)
Response:
{
"isSuccess": true,
"error": "",
"circle": *circle*
}
Request:
/webapi/circle/updateCircle
POST params:
id : (String)(required)
name : (String)
Response:
{
"isSuccess": true,
"error": "",
"circle": *circle*
}
Request:
/webapi/circle/deleteCircle
POST params:
id : (String)(required)
Response:
{
"isSuccess": true,
"error": "",
"circle": *circle*
}
Request:
/webapi/circle/getCircleBySearch
POST params:
name : (String)(required)(query string on names)
Response:
{
"isSuccess": true,
"error": "",
"circles": [*circles*]
}