-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
Insane edited this page Sep 9, 2015
·
1 revision
https://www.cocobabys.com/kindergarten/93740362/conversation/123456789?from=1&to=2&most=25
phone家长电话号码 from=起始id,不包括 to=结束id,不包括
[{"phone":"123456789","timestamp":1392968799188,"id":1392968799188,"content":"我很满意学校的服务",
"image":"http://suoqin-test.u.qiniudn.com/FgPmIcRG6BGocpV1B9QMCaaBQ9LK","sender":""},
{"phone":"123456789","timestamp":1392967799188,"id":1392967799188,"content":"谢谢你的鼓励",
"image":"http://suoqin-test.u.qiniudn.com/Fget0Tx492DJofAy-ZeUg1SANJ4X","sender":"带班老师", "sender_id": "13999234231"}]sender为空表示家长发送,sender非空则表示老师发送,非空时内容为发送老师的名字, sender_id是老师电话号码,可以通过employee接口查询老师的信息
POST https://www.cocobabys.com/kindergarten/93740362/conversation/123456789
request payload:
{"phone":"123456789","timestamp":1392967799188,"content":"谢谢你的鼓励","image":"http://suoqin-test.u.qiniudn.com/Fget0Tx492DJofAy-ZeUg1SANJ4X","sender":"带班老师"}增加一个参数retrieve_recent_from保证服务器在收到新消息时直接返回最近的25条信息。工作原理是: 例:retrieve_recent_from=100 POST https://www.cocobabys.com/kindergarten/93740362/conversation/123456789?retrieve_recent_from=100 返回的结果为:返回服务器端包括最新创建的信息(假设编号为120)在内的,从id=101开始到id=120的信息,id从大到小排列,如果符合条件的信息超过25条只返回25条,因此可能新创建的信息不会返回。