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

1. GET /kindergarten/:kg/news

parameters: from, to, most, class_id https://www.cocobabys.com/kindergarten/93740362/news?from=1388535400000&to=1388634400009&most=2

if class_id is specified, response will contain both public and class specified news, otherwise, response contains public news by default.

if both class_id and restrict=true are specified, response will contain class specified news only.

class_id can be given in formation: class_id=123,345,567 which means get all public news and 3 specified classes i.e. https://www.cocobabys.com/kindergarten/93740362/news?class_id=123,345,567

json response:

[{"news_id":10,"school_id":93740362,"title":"香蕉","content":"问问v","timestamp":1394646317885,"published":true,"notice_type":2,"class_id":777999, "image":""},

{"news_id":6,"school_id":93740362,"title":"通知14","content":"测试信息","timestamp":1387353640,"published":true,"notice_type":2,"class_id":0, "image":"http://suoqin-test.u.qiniudn.com/Fmz0zi5Y7qZw1spdUidluOQ2PvXm"}]

2. GET /kindergarten/:kg/news/:newsId

json response:

{"news_id":2,"school_id":93740362,"title":"通知2","content":"学校停电","timestamp":1387353636,"published":true,"notice_type":2, "class_id":0, "image":""}

3. POST /kindergarten/:kg/news/:newsId

class_id = 0 means a public news(its scope is the whole school)

request payload:

{
      "news_id": 1,
      "school_id": 93740362,
      "title" : "updated title",
      "content" : "updated content",
      "published": "王老师",
      "class_id": 0,
      "image":"http://suoqin-test.u.qiniudn.com/Fmz0zi5Y7qZw1spdUidluOQ2PvXm"
}

image is optional.

4. DELETE /kindergarten/:kg/news/:newsId

request payload:

{"error_code": 0}

5. GET /kindergarten/:kg/admin/:adminId/news

not applicable from mobile app

6. POST /kindergarten/:kg/admin/:adminId/news

not applicable from mobile app

7. POST /kindergarten/:kg/admin/:adminId/news/:newsId

not applicable from mobile app

8. DELETE /kindergarten/:kg/admin/:adminId/news/:newsId

not applicable from mobile app

9. POST /api/v2/kindergarten/:kg/news/:newsId/reader

mark given news is read by particular parent.

request payload: (information of parent itself)

{
  "school_id": 123456, 
  "name": "老王", 
  "phone": "13402995318", 
  "portrait": "http://baidu.com/image.png", 
  "gender": 0, 
  "birthday": "1980-1-1",
  "parent_id": "1_123456_321",
  "timestamp" : 1231231231231,
  "member_status": 1,
  "status": 1
}

ref to: https://github.com/kulebao/web/wiki/Parent-information#3-get-----------kindergartenkgparentphone

json response:

{"error_code":0}

10. GET /api/v2/kindergarten/:kg/news

Support tag parameter, ?tag=1 or ?tag=true will make this interface return response with tags:

{"news_id":11,"school_id":93740362,"title":"通知14","content":"测试信息","timestamp":1426691242108,"published":true,"notice_type":2,"class_id":0,"image":"","publisher_id":"3_93740362_3344","feedback_required":false,"tags":["作业","活动"]}   

11. GET /api/v2/kindergarten/:kg/news/:newsId

Almost the same as 10, but for one news record each time.

12.GET /api/v2/kindergarten/:kg/news/:newsId/reader/:parentId

To check the status of particular parent read one news or not.

Clone this wiki locally