Skip to content
Insane edited this page Sep 9, 2015 · 1 revision

1. GET /kindergarten/:kg/parent

json response:

[
{"parent_id":"2_93740362_456","school_id":93740362,"name":"林玄","phone":"18980030903","portrait":"http://suoqin-test.u.qiniudn.com/FvX4rSaBmkcTGNJGMfpQVQNnEqh-","gender":1,"birthday":"1800-01-01", "timestamp":1394583904098, "member_status": 1,"status": 1},
{"parent_id":"2_93740362_789","school_id":93740362,"name":"袋鼠","phone":"13408654680","portrait":"","gender":0,"birthday":"1800-01-01","timestamp":1394583904098, "member_status": 1,"status": 1}
]

gender: male is 1, female is 0

2. POST /kindergarten/:kg/parent

not applicable from mobile app

parent_id is optional, if it is specified, then we will create a new parent with given parent_id, or update it if it is existing.

request payload:

{
  "school_id": 93740362, 
  "name": "鑫哥", 
  "phone": "13402815318", 
  "portrait": "http://baidu.com/image.png", 
  "gender": 0, 
  "birthday": "1980-1-1",
  "parent_id": "1_93740362_11"
}

json response :

{
  "parent_id": "1_93740362_11",
  "school_id":93740362,
  "name":"鑫哥",
  "phone":"13402815317",
  "portrait":"http://baidu.com/image.png",
  "gender":0,
  "birthday":"1980-01-01",
  "timestamp":1394583904098
}

3. GET /kindergarten/:kg/parent/:phone

json response : {"id":"2_93740362_123","school_id":93740362,"name":"李毅","phone":"13402815317","portrait":"","gender":1,"birthday":"1800-01-01"}

4. POST /kindergarten/:kg/parent/:phone

parent_id is optional, if it is specified, then we will create a new parent with given parent_id, or update it if it is existing.

timestamp is optional, it will be used for data merging.

member_status is optional, 1 means parent has paid for their usage, otherwise not.

status is optional, 1 means parent is still exists, otherwise it has been removed from Cobabys system.

request payload:

{
  "school_id": 93740362, 
  "name": "鑫哥", 
  "phone": "13402815318", 
  "portrait": "http://baidu.com/image.png", 
  "gender": 0, 
  "birthday": "1980-1-1",
  "parent_id": "1_93740362_11",
  "timestamp" : 1231231231231,
  "member_status": 1,
  "status": 1
}

json response :

{
  "parent_id": "1_93740362_11",
  "school_id":93740362,
  "name":"鑫哥",
  "phone":"13402815317",
  "portrait":"http://baidu.com/image.png",
  "gender":0,
  "birthday":"1980-01-01",
  "timestamp":1394583904098,
  "member_status": 1,
  "status": 1
}

5. DELETE /kindergarten/:kg/parent/:phone

json response:

{"error_code":0}

Clone this wiki locally