[关闭]
@originxp 2017-11-13T17:42:50.000000Z 字数 2470 阅读 523

im群发


1.群发接口

1.1 针对多个uid进行群发的功能

URL : /api2/groupSendMessage
请求方式: post
请求参数:

  1. {
  2. "ownerId": "190001",
  3. "token": "saoiewrnxczmnvkjsafo0324ijidfuio",
  4. "body": {
  5. "text": "jwiwimm"
  6. },
  7. "type": "Text",
  8. "sendKey":"1493009837628",
  9. "sendUids": [
  10. "34322",
  11. "5564",
  12. "23424"
  13. ]
  14. }

注:
* sendUids数组length小于500
* sendKey为13位的时间戳

返回格式

  1. {
  2. "data": {"sendKey":"1493009837628"},
  3. "message": "success",
  4. "ok": true
  5. }

1.2 针对 科室,警戒值 等进行群发

URL : /api2/groupSendSpecificMessage
请求方式: post
请求参数:

  1. {
  2. "ownerId": "190001",
  3. "token": "saoiewrnxczmnvkjsafo0324ijidfuio",
  4. "body": {
  5. "text": "jwiwimm"
  6. },
  7. "type": "Text",
  8. "sendKey":"1493009837628",
  9. "SpeBody": {
  10. "科室id":"19933",
  11. "科室参数":"234"
  12. }
  13. }

注:

返回格式

  1. {
  2. "data": {"sendKey":"1493009837628"},
  3. "message": "success",
  4. "ok": true
  5. }

2.历史聊天列表

接口请求不做修改,返回值格式

  1. 添加群发消息后的格式:
  2. {
  3. "data": [
  4. {
  5. "chatMessage": {
  6. "body": {
  7. "text": "jwiwimm"
  8. },
  9. "clientMsgId": 150951694867153200,
  10. "createDate": 1509516948000,
  11. "groupId": 47752,
  12. "id": 874405,
  13. "ownerId": "1902915",
  14. "system": false,
  15. "to": "1902915",
  16. "type": "Text",
  17. "version": "2.0"
  18. },
  19. "doctorId": "1901292",
  20. "doctorName": "控糖顾问",
  21. "createDate": 1502960773000,
  22. "gmtModified": 1502960773000,
  23. "id": 47752,
  24. "name": "1901292-1902915",
  25. "ownerId": "1902915",
  26. "ownerName": "Ant",
  27. "patientId": "1902915",
  28. "patientName": "Ant",
  29. "type": 1,
  30. "unreadCount": 16
  31. },
  32. {
  33. "body": {
  34. "text": "jwiwimm"
  35. },
  36. "type": "Text",
  37. "ownerId": "199083",
  38. "createDate": "1502960773000",
  39. "sendKey": "1402960773000",
  40. "uidCount": "59",
  41. "receiveNames": "煎蛋,糖友2343,巅峰,堂渔鸥,糖友98932,糖友32332"
  42. },
  43. ],
  44. "message": "success",
  45. "ok": true
  46. }

3.历史群聊详情

URL : /api2/groupSendMessageDetail
请求方式: post
请求参数:

  1. {
  2. "ownerId": "199083",
  3. "token": "saoiewrnxczmnvkjsafo0324ijidfuio",
  4. "start": "0",
  5. "limit": "20"
  6. }

返回值

  1. {
  2. "data": [
  3. {
  4. "body": {
  5. "text": "jwiwimm"
  6. },
  7. "type": "Text",
  8. "ownerId": "199083",
  9. "createDate": "1502960773000",
  10. "sendKey": "1402960773000",
  11. "uidCount": "59",
  12. "receiveNames": "煎蛋,糖友2343,巅峰,堂渔鸥,糖友98932,糖友32332"
  13. },
  14. {
  15. "body": {
  16. "text": "发我IE如确认"
  17. },
  18. "type": "Text",
  19. "ownerId": "199083",
  20. "createDate": "1502960773000",
  21. "sendKey": "1402960773000",
  22. "uidCount": "159",
  23. "receiveNames": "煎蛋,糖友2343,巅峰,堂渔鸥,糖友98932,糖友32332"
  24. }
  25. ],
  26. "message": "success",
  27. "ok": true
  28. }

4.群发用户详情

medical接口
URL : /chat/groupSendReceiveDetail
请求方式: post
请求参数:

  1. {
  2. "ownerId": "199083",
  3. "token": "saoiewrnxczmnvkjsafo0324ijidfuio",
  4. "sendKey": "1402960773000",
  5. "start": "0",
  6. "limit": "20"
  7. }

返回格式

  1. {
  2. "header": {
  3. "code": 2000,
  4. "message": "OK"
  5. },
  6. "body": [
  7. {
  8. "sex": "1",
  9. "avatarPath": "",
  10. "diabetesName": "2型糖尿病",
  11. "userName": "糖友_911235",
  12. "userId": "1409807",
  13. "age": "50"
  14. },
  15. {
  16. "sex": "1",
  17. "avatarPath": "",
  18. "diabetesName": "2型糖尿病",
  19. "userName": "糖友_684515",
  20. "userId": "1406926",
  21. "age": "50"
  22. },
  23. {
  24. "sex": "1",
  25. "avatarPath": "/avatar/1474188_avatar.png",
  26. "diabetesName": "2型糖尿病",
  27. "userName": "糖友_269049",
  28. "userId": "1474188",
  29. "age": "50"
  30. }
  31. ]
  32. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注