目录

第三方应用 - API列表

优质
小牛编辑
131浏览
2023-12-01

调用API:

  1. POST https://ppmessage.com/api/xxxxx

https header应为(xxxx应该用token替代):

  1. {
  2. 'Content-Type': 'application/json',
  3. 'Authorization': 'OAuth xxxxx'
  4. }

api_level:获取到的token有固定的api level,使用该token只用调用该api_level对应的API接口。api_level有以下几种。

api_levelDescription
PPCOM用PPCOM的api_key, api_secret获取的token,可以调用此级别的API
PPKEFU用PPKEFU的api_key, api_secret获取的token,可以调用此级别的API
PPCONSOLE用PPCONSOLE的api_key, api_secret获取的token,可以调用此级别的API
THIRD_PARTY_KEFU用THIRD_PARTY_KEFU的api_key, api_secret获取的token,可以调用此级别的API
THIRD_PARTY_CONSOLE用THIRD_PARTY_CONSOLE的api_key, api_secret获取的token,可以调用此级别的API
PPCONSOLE_BEFORE_LOGIN用PPCONSOLE_BEFORE_LOGIN的api_key, api_secret获取的token,可以调用此级别的API

创建匿名用户

  1. POST /PP_CREATE_ANONYMOUS

api_level:

  1. PPCom

参数

NameTypeDescription
app_uuidstring客服团队的app_uuid
ppcom_trace_uuidstringppcom在浏览器端标示该匿名用户的uuid

返回结果(例子):

  1. {
  2. 'error_code': 0,
  3. 'error_string': 'success.',
  4. 'uri': '/PP_CREATE_ANONYMOUS',
  5. 'user_fullname': 'Unknown Area.User',
  6. 'user_icon': 'http://127.0.0.1:8080/identicon/7dac54f4-1b11-11e6-8b7a-0242ac110002.png',
  7. 'user_uuid': '7dac54f4-1b11-11e6-8b7a-0242ac110002',
  8. 'user_email': '7dac54@1ca35f'
  9. }

创建用户

  1. POST /PP_CREATE_USER

api_level:

  1. PPCONSOLE, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队的app_uuid
user_emailstring用户的登录邮箱
user_fullnamestring用户的全称
user_languagestring用户语言,可为”en”, “zh-cn”, “zh-tw”
user_passwordstring用户密码
is_service_userboolean用户是否是客服
user_statusstring用户状态,值可为”OWNER_0”, “OWNER_1”, “OWNER_2”, “OWNER_3”, “ADMIN”, “SERVICE”, “ANONYMOUS”, “THIRDPARTY”。如果不提供,默认为”THIRDPARTY”

返回结果(例子):

  1. {
  2. 'user_status': u'SERVICE',
  3. 'uuid': '97f90762-1c10-11e6-9869-0242ac110002',
  4. 'error_string': 'success.',
  5. 'is_anonymous_user': False,
  6. 'user_name': u'dancer-info@ppmessage.com',
  7. 'user_password': u'40bd001563085fc35165329ea1ff5c5ecbdbbeef',
  8. 'user_fullname': u'dancer-info',
  9. 'uri': '/PP_CREATE_USER',
  10. 'user_language': None,
  11. 'error_code': 0,
  12. 'user_email': u'dancer-info@ppmessage.com'
  13. }

删除用户

  1. POST /PP_REMOVE_USER

api_level:

  1. PPCONSOLE, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
user_uuidstring用户uuid
user_passwordstring用户密码

返回结果(例子)

  1. {
  2. 'error_cdoe': 0,
  3. 'error_string': 'success.',
  4. 'uri': '/PP_REMOVE_USER'
  5. }

更新用户

  1. POST /PP_UPDATE_USER

api_level:

  1. PPCOM, PPKEFU, PPCONSOLE, THIRD_PARTY_KEFU, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid
user_uuidstring用户uuid
is_distributor_userboolean设置用户是否是distributor user
old_passwordstring旧密码
new_passwordstring新密码

返回结果(例子)

  1. {
  2. 'error_cdoe': 0,
  3. 'error_string': 'success.',
  4. 'uri': '/PP_UPDATE_USER'
  5. }

创建设备

  1. POST /PP_CREATE_DEVICE

api_level:

  1. PPCOM

参数

NameTypeDescription
app_uuidstring客服团队uuid
user_uuidstring用户uuid
device_idstring设备id
device_ostypestring设备操作系统类型
ppcom_trace_uuidstringPPCom在浏览器端标示用户的uuid

说明

  1. "AND", # ANDROID
  2. "IOS", # IOS
  3. "ANB", # ANDROID BROWSER
  4. "IOB", # IOS BROWSER
  5. "WIP", # WIN PHONE
  6. "MAC", # MAC OS X PC
  7. "LIN", # LINUX PC
  8. "WIN", # WINDOWS PC
  9. "MAB", # MAC BROWSER
  10. "LIB", # LINUX BROWSER
  11. "WIB", # WINDOWS BROWSER
  12. "W32", # WINDOWS 32 BIT
  13. "W64", # WINDOWS 64 BIT

返回结果(例子)

  1. {
  2. 'error_code': 25,
  3. 'uri': '/PP_CREATE_DEVICE',
  4. 'error_string': 'device existed.',
  5. 'device_uuid': '3534d9da-1828-11e6-946e-0242ac110002'
  6. }

更新设备

  1. POST /PP_UPDATE_DEVICE

api_level:

  1. PPCOM, PPKEFU, THIRD_PARTY_KEFU

参数

NameTypeDescription
device_uuidstring设备uuid
device_fullnamestring设备全称
device_phonenumberstring设备电话号码
device_ostypestring设备操作系统类型
device_osversionstring设备操作系统版本
device_android_apilevelstring安卓设备api level
device_android_gcmtokenstring安卓设备gcm token
device_android_gcmpushboolean安卓设备是否使用gcm推送
device_ios_modelstringiOS设备model
device_ios_tokenstringiOS设备token
device_is_onlinestring设备是否在线

返回结果(例子)

  1. {
  2. 'error_cdoe': 0,
  3. 'error_string': 'success.',
  4. 'uri': '/PP_UPDATE_DEVICE'
  5. }

创建对话

  1. POST /PP_CREATE_CONVERSATION

api_level:

  1. PPCOM, PPKEFU, THIRD_PARTY_KEFU

参数

NameTypeDescription
app_uuidstring客服团队uuid
user_uuidstring设备全称
conversation_typestring对话类型,可为”P2S”, “S2S”
conversation_namestring对话名称
member_listlist成员列表,如果对话类型为S2S,则必须提供此参数
group_uuidstring对话的组uuid

返回结果(例子)

  1. {
  2. 'uri': '/PP_CREATE_CONVERSATION',
  3. 'error_code': 0,
  4. 'error_string': 'success.',
  5. 'status': 'NEW',
  6. 'conversation_type': u'S2S',
  7. 'conversation_icon': None,
  8. 'uuid': '92035b7a-1c1d-11e6-a4dd-0242ac110002',
  9. 'createtime': datetime.datetime(2016, 5, 17, 10, 53, 21, 73728),
  10. 'updatetime': datetime.datetime(2016, 5, 17, 10, 53, 21, 73728),
  11. 'group_uuid': None,
  12. 'createtimestamp': 1463482401.073728,
  13. 'app_uuid': u'1ca35f40-17f1-11e6-9d01-0242ac110003',
  14. 'conversation_name': 'right',
  15. 'updatetimestamp': 1463482401.073728,
  16. 'assigned_uuid': u'89d63aee-1c1d-11e6-a4dd-0242ac110002',
  17. 'user_uuid': u'1ca235d4-17f1-11e6-9d01-0242ac110003',
  18. 'user_list': [u'89d63aee-1c1d-11e6-a4dd-0242ac110002']
  19. }

获取对话信息

  1. POST /PP_GET_CONVERSATION_INFO

api_level:

  1. PPCOM, PPKEFU, PPCONSOLE, THIRD_PARTY_KEFU, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
conversation_uuidstring对话uuid
app_uuidstring客服团队uuid
user_uuidstring用户uuid

返回结果(例子)

  1. {
  2. 'status': 'OPEN',
  3. 'conversation_type': 'P2S',
  4. 'updatetime': datetime.datetime(2016, 5, 17, 11, 13, 58, 509645),
  5. 'uuid': '0ab12db4-1c1d-11e6-a4dd-0242ac110002',
  6. 'error_string': 'success.',
  7. 'conversation_data': {
  8. 'conversation_type': 'P2S',
  9. 'updatetime': datetime.datetime(2016, 5, 17, 11, 13, 58, 511172),
  10. 'uuid': '0ab3f9c2-1c1d-11e6-a4dd-0242ac110002',
  11. 'conversation_uuid': '0ab12db4-1c1d-11e6-a4dd-0242ac110002',
  12. 'user_mute_notification': None,
  13. 'conversation_icon': 'http://127.0.0.1:8080/identicon/351f147e-1828-11e6-946e-0242ac110002.png',
  14. 'conversation_status': 'OPEN',
  15. 'app_uuid': '1ca35f40-17f1-11e6-9d01-0242ac110003',
  16. 'user_name': None,
  17. 'conversation_name': 'Unknown Area.User',
  18. 'user_uuid': '1ca235d4-17f1-11e6-9d01-0242ac110003',
  19. 'createtime': datetime.datetime(2016, 5, 17, 10, 49, 34, 57641)
  20. },
  21. 'latest_task': '119dab7d-98d9-42c7-f4ca-ad80f8a65fdb',
  22. 'user_uuid': '351f147e-1828-11e6-946e-0242ac110002',
  23. 'uri': '/PP_GET_CONVERSATION_INFO',
  24. 'group_uuid': None,
  25. 'conversation_icon': None,
  26. 'app_uuid': '1ca35f40-17f1-11e6-9d01-0242ac110003',
  27. 'conversation_name': None,
  28. 'assigned_uuid': '1ca235d4-17f1-11e6-9d01-0242ac110003',
  29. 'error_code': 0,
  30. 'createtime': datetime.datetime(2016, 5, 17, 10, 49, 34, 56363)
  31. }

获取客服团队下的所有对话

  1. POST /PP_GET_APP_CONVERSATION_LIST

api_level:

  1. PPCOM, PPKEFU, PPCONSOLE, THIRD_PARTY_KEFU, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid

返回结果(例子)

  1. {
  2. 'list': [
  3. {
  4. 'status': 'OPEN',
  5. 'conversation_type': 'P2S',
  6. 'updatetime': datetime.datetime(2016, 5, 17, 11, 13, 58, 509645),
  7. 'uuid': '0ab12db4-1c1d-11e6-a4dd-0242ac110002',
  8. 'latest_message': {
  9. 'body': '2',
  10. 'conversation_type': 'P2S',
  11. 'updatetime': datetime.datetime(2016, 5, 17, 11, 13, 58, 519090),
  12. 'uuid': '119dab7d-98d9-42c7-f4ca-ad80f8a65fdb',
  13. 'from_uuid': '351f147e-1828-11e6-946e-0242ac110002',
  14. 'conversation_uuid': '0ab12db4-1c1d-11e6-a4dd-0242ac110002',
  15. 'title': None,
  16. 'to_device_uuid': None,
  17. 'from_type': 'DU',
  18. 'from_device_uuid': '3534d9da-1828-11e6-946e-0242ac110002',
  19. 'is_development': None,
  20. 'to_type': 'AP',
  21. 'app_uuid': '1ca35f40-17f1-11e6-9d01-0242ac110003',
  22. 'to_uuid': '0ab12db4-1c1d-11e6-a4dd-0242ac110002',
  23. 'message_body': '{
  24. "ci": "0ab12db4-1c1d-11e6-a4dd-0242ac110002",
  25. "ft": "DU",
  26. "tt": "AP",
  27. "bo": "2",
  28. "ts": 1463483638.508707,
  29. "mt": "NOTI",
  30. "tl": null,
  31. "ms": "TEXT",
  32. "ti": "0ab12db4-1c1d-11e6-a4dd-0242ac110002",
  33. "fi": "351f147e-1828-11e6-946e-0242ac110002",
  34. "id": "119dab7d-98d9-42c7-f4ca-ad80f8a65fdb",
  35. "ct": "P2S"
  36. }',
  37. 'task_status': 'PROCESSED',
  38. 'message_type': 'NOTI',
  39. 'createtime': datetime.datetime(2016, 5, 17, 11, 13, 58, 508707),
  40. 'message_subtype': 'TEXT'
  41. },
  42. 'latest_task': '119dab7d-98d9-42c7-f4ca-ad80f8a65fdb',
  43. 'conversation_icon': None,
  44. 'group_uuid': None,
  45. 'create_user': {
  46. 'user_firstname': None,
  47. 'user_mute_other_mobile_device': None,
  48. 'create_status': None,
  49. 'user_wechat': None,
  50. 'mobile_device_uuid': None,
  51. 'user_company': None,
  52. 'user_status': 'ANONYMOUS',
  53. 'ppcom_browser_device_uuid': '3534d9da-1828-11e6-946e-0242ac110002',
  54. 'uuid': '351f147e-1828-11e6-946e-0242ac110002',
  55. 'user_lastname': None,
  56. 'user_qq': None,
  57. 'user_icon': 'http://127.0.0.1:8080/identicon/351f147e-1828-11e6-946e-0242ac110002.png',
  58. 'user_defined': None,
  59. 'user_mobile': None,
  60. 'user_signature': None,
  61. 'is_email_verified': None,
  62. 'browser_device_uuid': None,
  63. 'user_name': 'Unknown Area.User',
  64. 'is_anonymous_user': True,
  65. 'service_user_status': None,
  66. 'ppcom_trace_uuid': 'ce4253cc-6fd6-45ae-ebe5-042e74aa46c1',
  67. 'user_show_badge': None,
  68. 'user_language': None,
  69. 'latest_send_message_time': datetime.datetime(2016, 5, 12, 9, 59, 56),
  70. 'updatetime': datetime.datetime(2016, 5, 17, 9, 59, 6, 686846),
  71. 'user_silence_notification': None,
  72. 'is_mobile_verified': None,
  73. 'user_fullname': 'Unknown Area.User',
  74. 'createtime': datetime.datetime(2016, 5, 12, 9, 59, 26),
  75. 'user_mute_notification': None,
  76. 'ppcom_mobile_device_uuid': None,
  77. 'user_email': '351f14@1ca35f'
  78. },
  79. 'app_uuid': '1ca35f40-17f1-11e6-9d01-0242ac110003',
  80. 'conversation_name': None,
  81. 'message_total_count': 1,
  82. 'assigned_uuid': '1ca235d4-17f1-11e6-9d01-0242ac110003',
  83. 'user_uuid': '351f147e-1828-11e6-946e-0242ac110002',
  84. 'createtime': datetime.datetime(2016, 5, 17, 10, 49, 34, 56363)
  85. }
  86. ],
  87. 'error_code': 0,
  88. 'uri': '/PP_GET_APP_CONVERSATION_LIST',
  89. 'error_string': 'success.'
  90. }

获取用户的所有对话

  1. POST /PP_GET_USER_CONVERSATION_LIST

api_level:

  1. PPCOM, PPKEFU, PPCONSOLE, THIRD_PARTY_KEFU, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid
user_uuidstring用户uuid

返回结果(例子)

  1. {
  2. 'list': [],
  3. 'error_code': 0,
  4. 'uri': '/PP_GET_USER_CONVERSATION_LIST',
  5. 'error_string': 'success.'
  6. }

开启对话

一个对话的状态为CLOSE状态,当调用API接口获取对话列表时,这个对话总是会被忽略。要取消忽略,需要设置对话状态为OPEN,即开启对话。

  1. POST /PP_OPEN_CONVERSATION

api_level:

  1. PPCOM, PPKEFU, PPCONSOLE, THIRD_PARTY_KEFU, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid
user_uuidstring用户uuid
conversation_uuidstring对话uuid

返回结果(例子)

  1. {
  2. 'uri': '/PP_OPEN_CONVERSATION',
  3. 'error_code': 0,
  4. 'error_string': 'success.'
  5. }

关闭对话

一个对话的状态为CLOSE状态,当调用API接口获取对话列表时,这个对话总是会被忽略。要忽略对话,需要设置对话状态为CLOSE,即关闭对话。

  1. POST /PP_CLOSE_CONVERSATION

api_level:

  1. PPCOM, PPKEFU, PPCONSOLE, THIRD_PARTY_KEFU, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid
user_uuidstring用户uuid
conversation_uuidstring对话uuid

返回结果(例子)

  1. {
  2. 'uri': '/PP_OPEN_CONVERSATION',
  3. 'error_code': 0,
  4. 'error_string': 'success.'
  5. }

获取客服团队信息

  1. POST /PP_GET_APP_INFO

api_level:

  1. PPCOM, PPKEFU, PPCONSOLE, THIRD_PARTY_KEFU, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid

返回结果(例子)

  1. {
  2. 'return_offline_message': None,
  3. 'app_name': 'ppmessage',
  4. 'app_secret': 'Mzg2ODliNjVlY2I2NzBlNTExMmJkMTE4YzM3MjRlMjUxN2U1MjEwMg==',
  5. 'robot_user_uuid': None,
  6. 'api_uuid': '1ca64836-17f1-11e6-9d01-0242ac110003',
  7. 'robot_train_track': None,
  8. 'app_billing_email': None,
  9. 'uuid': '1ca35f40-17f1-11e6-9d01-0242ac110003',
  10. 'welcome_message': None,
  11. 'app_icon': None,
  12. 'ppcom_powered_by_visible': None,
  13. 'ppcom_powered_by_link': None,
  14. 'company_name': 'YOURUI',
  15. 'ppcom_launcher_style': None,
  16. 'ppcom_powered_by_name': None,
  17. 'robot_train_click': None,
  18. 'offline_message': None,
  19. 'app_key': 'NjZlZGNiMGEzOTg4NmNjYWQ2NDIxNDZiN2ZiZTljZTA1NTFiZjdlNw==',
  20. 'show_ppcom_hover': None,
  21. 'updatetime': datetime.datetime(2016, 5, 12, 3, 25, 1),
  22. 'app_route_policy': None,
  23. 'error_string': 'success.',
  24. 'robot_train_method': None,
  25. 'user_uuid': '1ca235d4-17f1-11e6-9d01-0242ac110003',
  26. 'uri': '/PP_GET_APP_INFO',
  27. 'robot_train_chat': None,
  28. 'app_billing_uuid': None,
  29. 'error_code': 0,
  30. 'createtime': datetime.datetime(2016, 5, 12, 3, 25, 1),
  31. 'ppcom_launcher_color': None
  32. }

获取客服团队下所有客服

  1. POST /PP_GET_APP_SERVICE_USER_LIST

api_level:

  1. PPCOM, PPKEFU, PPCONSOLE, THIRD_PARTY_KEFU, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid

返回结果(例子)

  1. {
  2. 'list': [
  3. {
  4. 'updatetime': datetime.datetime(2016, 5, 18, 2, 36, 19, 726229),
  5. 'group': None,
  6. 'uuid': '1ca235d4-17f1-11e6-9d01-0242ac110003',
  7. 'user_fullname': 'Jin He',
  8. 'user_icon': '01a17ddc-1821-11e6-9b56-0242ac110003',
  9. 'is_browser_online': True,
  10. 'user_signature': 'fight to the death ~',
  11. u'is_owner_user': True,
  12. 'is_mobile_online': False,
  13. u'is_distributor_user': True,
  14. 'user_email': 'jin.he@ppmessage.com',
  15. u'is_service_user': True
  16. },
  17. {
  18. 'updatetime': datetime.datetime(2016, 5, 17, 10, 53, 7),
  19. 'group': None,
  20. 'uuid': '89d63aee-1c1d-11e6-a4dd-0242ac110002',
  21. 'user_fullname': 'right',
  22. 'user_icon': None,
  23. 'is_browser_online': False,
  24. 'user_signature': None,
  25. u'is_owner_user': False,
  26. 'is_mobile_online': False,
  27. u'is_distributor_user': True,
  28. 'user_email': 'right@ppmessage.com',
  29. u'is_service_user': True
  30. }
  31. ],
  32. 'error_code': 0,
  33. 'uri': '/PP_GET_APP_SERVICE_USER_LIST',
  34. 'error_string': 'success.'
  35. }

获取用户uuid(需改名)

检查服务器是否有某个email对应的用户,如果没有,则创建这个用户,并返回用户uuid;如果有这个用户并且这个用户是客服,则返回错误;如果有这个用户并且这个用户不是客服,则返回用户uuid。

  1. POST /PP_GET_USER_UUID

api_level:

  1. PPCOM

参数

NameTypeDescription
app_uuidstring客服团队uuid
user_emailstring用户邮箱
user_iconstring用户头像,如果需要创建用户,会用到
user_fullnamestring用户全称,如果需要创建用户,会用到

返回结果(例子)

  1. {
  2. 'error_code': 0,
  3. 'error_string': 'success.',
  4. 'uri': '/PP_GET_USER_UUID',
  5. 'user_uuid': '1ca64836-17f1-11e6-9d01-0242ac110003'
  6. }

获取对话历史消息

获取对话中的历史消息,可以按页(page_size, page_offset)获取;也可以按照消息id范围(since_id, max_id)获取。

  1. POST /PP_GET_HISTORY_MESSAGE

api_level:

  1. PPCOM, PPKEFU, PPCONSOLE, THIRD_PARTY_KEFU, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
conversation_uuidstring客服团队uuid
page_offsetstring第几页消息
page_sizestring一页消息的数目
since_idstring最早一条历史消息的id
max_idstring最近一条历史消息的id

返回结果(例子)

  1. {
  2. 'error_code': 0,
  3. 'error_code': 'success.',
  4. 'uri': '/PP_GET_HISTORY_MESSAGE',
  5. 'total_count': 23,
  6. 'count': 12,
  7. 'page_size': 12,
  8. 'page_offset': 0,
  9. 'list': [
  10. ...
  11. ],
  12. 'max_id': 'xxxx'
  13. }

获取用户信息

  1. POST /PP_GET_USER_INFO

api_level:

  1. PPCOM, PPKEFU, PPCONSOLE, THIRD_PARTY_KEFU, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid
user_uuidstring用户uuid

返回结果(例子)

  1. {
  2. ...
  3. }

获取客服团队的客服组列表

  1. POST /PP_GET_APP_ORG_GROUP_LIST

api_level:

  1. PPCOM, PPKEFU, PPCONSOLE, THIRD_PARTY_KEFU, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid

返回结果(例子)

  1. {
  2. 'list': [
  3. {
  4. 'updatetime': '2016-05-18 04:56:45 515792',
  5. 'user_count': 2,
  6. 'group_icon': 'http://127.0.0.1:8080/identicon/be625d18d0b96a0b2e2e26c95a4b59e1625348ab.png',
  7. 'uuid': 'e00ab5b0-1cb4-11e6-9894-0242ac110002',
  8. 'conversation_uuid': None,
  9. 'is_distributor': True,
  10. 'group_desc': 'a dancer club',
  11. 'group_name': 'Dancer Club',
  12. 'app_uuid': '1ca35f40-17f1-11e6-9d01-0242ac110003',
  13. 'createtime': '2016-05-18 04:56:26 024830'
  14. }
  15. ],
  16. 'error_code': 0,
  17. 'uri': '/PP_GET_APP_ORG_GROUP_LIST',
  18. 'error_string': 'success.'
  19. }

获取客服组信息

  1. POST /PP_GET_ORG_GROUP_DETAIL

api_level:

  1. PPCOM, PPKEFU, PPCONSOLE, THIRD_PARTY_KEFU, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid
group_uuidstring客服组uuid

返回结果(例子)

  1. {
  2. 'group_route_algorithm': None,
  3. 'group_visible_order_for_ppcom': None,
  4. 'updatetime': datetime.datetime(2016, 5, 18, 4, 56, 45, 515792),
  5. 'uuid': 'e00ab5b0-1cb4-11e6-9894-0242ac110002',
  6. 'error_string': 'success.',
  7. 'conversation_uuid': None,
  8. 'createtime': datetime.datetime(2016, 5, 18, 4, 56, 26, 24830),
  9. 'is_distributor': True,
  10. 'uri': '/PP_GET_ORG_GROUP_DETAIL',
  11. 'group_desc': 'a dancer club',
  12. 'is_root': None,
  13. 'group_uuid': 'e00ab5b0-1cb4-11e6-9894-0242ac110002',
  14. 'app_uuid': '1ca35f40-17f1-11e6-9d01-0242ac110003',
  15. 'group_work_time_str': None,
  16. 'group_name': 'Dancer Club',
  17. 'error_code': 0,
  18. 'group_icon': 'http://127.0.0.1:8080/identicon/be625d18d0b96a0b2e2e26c95a4b59e1625348ab.png',
  19. 'group_visible_for_ppcom': None
  20. }

获取客服组的客服列表

  1. POST /PP_GET_ORG_GROUP_USER_LIST

api_level:

  1. PPCOM, PPKEFU, PPCONSOLE, THIRD_PARTY_KEFU, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid
group_uuidstring客服组uuid

返回结果(例子)

  1. {
  2. 'list': [
  3. {
  4. 'updatetime': 1463547414,
  5. 'group': {
  6. 'uuid': 'e00ab5b0-1cb4-11e6-9894-0242ac110002',
  7. 'group_name': 'Dancer Club'
  8. },
  9. 'uuid': '1ca235d4-17f1-11e6-9d01-0242ac110003',
  10. 'user_fullname': 'Jin He',
  11. 'user_icon': '01a17ddc-1821-11e6-9b56-0242ac110003',
  12. 'is_browser_online': True,
  13. 'user_signature': 'fight to the death ~',
  14. 'is_mobile_online': False,
  15. 'user_email': 'jin.he@ppmessage.com'
  16. },
  17. {
  18. 'updatetime': 1463482387,
  19. 'group': {
  20. 'uuid': 'e00ab5b0-1cb4-11e6-9894-0242ac110002',
  21. 'group_name': 'Dancer Club'
  22. },
  23. 'uuid': '89d63aee-1c1d-11e6-a4dd-0242ac110002',
  24. 'user_fullname': 'right',
  25. 'user_icon': None,
  26. 'is_browser_online': False,
  27. 'user_signature': None,
  28. 'is_mobile_online': False,
  29. 'user_email': 'right@ppmessage.com'
  30. }
  31. ],
  32. 'error_code': 0,
  33. 'uri': '/PP_GET_ORG_GROUP_USER_LIST',
  34. 'error_string': 'success.'
  35. }

创建客服组

  1. POST /PP_CREATE_ORG_GROUP

api_level:

  1. PPCONSOLE, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid
group_namestring客服组名称
group_descstring客服组描述信息
is_distributorboolean是否设置为首选组

返回结果(例子)

  1. {
  2. 'group_visible_order_for_ppcom': None,
  3. 'group_desc': 'a music club',
  4. 'group_name': 'Music Club',
  5. 'is_root': None,
  6. 'group_work_time_str': None,
  7. 'group_visible_for_ppcom': None,
  8. 'group_route_algorithm': None,
  9. 'updatetime': datetime.datetime(2016, 5, 18, 6, 22, 1, 125540),
  10. 'uuid': 'd4c8c2bc-1cc0-11e6-b348-0242ac110002',
  11. 'error_string': 'success.',
  12. 'is_distributor': False,
  13. 'uri': '/PP_CREATE_ORG_GROUP',
  14. 'createtime': datetime.datetime(2016, 5, 18, 6, 22, 1, 125540),
  15. 'app_uuid': '1ca35f40-17f1-11e6-9d01-0242ac110003',
  16. 'error_code': 0,
  17. 'group_icon': 'http://127.0.0.1:8080/identicon/d4c8c2bc-1cc0-11e6-b348-0242ac110002.png'
  18. }

更新客服组

  1. POST /PP_UPDATE_ORG_GROUP

api_level:

  1. PPCONSOLE, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid
group_uuidstring客服组uuid
group_namestring客服组名称
group_descstring客服组描述信息
group_iconstring客服组头像
is_distributorboolean是否设置为首选组

返回结果(例子)

  1. {
  2. 'group_route_algorithm': None,
  3. 'group_visible_order_for_ppcom': None,
  4. 'updatetime': datetime.datetime(2016, 5, 18, 4, 56, 45, 515792),
  5. 'uuid': 'e00ab5b0-1cb4-11e6-9894-0242ac110002',
  6. 'error_string': 'success.',
  7. 'createtime': datetime.datetime(2016, 5, 18, 4, 56, 26, 24830),
  8. 'is_distributor': True,
  9. 'uri': '/PP_UPDATE_ORG_GROUP',
  10. 'group_desc': u'a dancer club',
  11. 'is_root': None,
  12. 'group_uuid': 'e00ab5b0-1cb4-11e6-9894-0242ac110002',
  13. 'app_uuid': '1ca35f40-17f1-11e6-9d01-0242ac110003',
  14. 'group_work_time_str': None,
  15. 'group_name': u'Dancer Club',
  16. 'error_code': 0,
  17. 'group_icon': 'http://127.0.0.1:8080/identicon/be625d18d0b96a0b2e2e26c95a4b59e1625348ab.png',
  18. 'group_visible_for_ppcom': None
  19. }

删除客服组

  1. POST /PP_REMOVE_ORG_GROUP

api_level:

  1. PPCONOSLE, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid
group_uuidstring客服组uuid

返回结果(例子)

  1. {
  2. 'error_code': 0,
  3. 'uri': '/PP_REMOVE_ORG_GROUP',
  4. 'error_string': 'success.'
  5. }

添加客服组成员

  1. POST /PP_ADD_ORG_GROUP_USER

api_level:

  1. PPCONOSLE, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid
group_uuidstring客服组uuid
user_listlist用户列表

返回结果(例子)

  1. {
  2. 'error_code': 0,
  3. 'uri': '/PP_ADD_ORG_GROUP_USER',
  4. 'error_string': 'success.'
  5. }

移除客服组成员

  1. POST /PP_REMOVE_ORG_GROUP_USER

api_level:

  1. PPCONOSLE, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid
group_uuidstring客服组uuid
user_listlist用户列表

返回结果(例子)

  1. {
  2. 'error_code': 0,
  3. 'uri': '/PP_REMOVE_ORG_GROUP_USER',
  4. 'error_string': 'success.'
  5. }

获取客服团队中不归属任何客服组的客服列表

  1. POST /PP_GET_NO_GROUP_USER_LIST

api_level:

  1. PPCOM, PPKEFU, PPCONOSLE, THIRD_PARTY_KEFU, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid

返回结果(例子)

  1. {
  2. 'list': [
  3. {
  4. 'user_status': 'ADMIN',
  5. 'updatetime': '2016-05-18 04:56:54 905611',
  6. 'uuid': '1ca235d4-17f1-11e6-9d01-0242ac110003',
  7. 'is_anonymous_user': 'False',
  8. 'user_lastname': 'He',
  9. 'user_password': '40bd001563085fc35165329ea1ff5c5ecbdbbeef',
  10. 'user_fullname': 'Jin He',
  11. 'service_user_status': 'READY',
  12. 'user_icon': '01a17ddc-1821-11e6-9b56-0242ac110003',
  13. 'user_signature': 'fight to the death ~',
  14. 'user_email': 'jin.he@ppmessage.com',
  15. 'browser_device_uuid': '68a2feca-1c1d-11e6-a4dd-0242ac110002',
  16. 'user_language': 'zh_cn',
  17. 'createtime': '2016-05-12 03:25:01 000000',
  18. 'latest_send_message_time': '2016-05-12 10:01:18 000000',
  19. 'user_firstname': 'Jin'
  20. },
  21. {
  22. 'user_status': 'SERVICE',
  23. 'updatetime': '2016-05-17 10:53:07 000000',
  24. 'uuid': '89d63aee-1c1d-11e6-a4dd-0242ac110002',
  25. 'is_anonymous_user': 'False',
  26. 'user_password': '40bd001563085fc35165329ea1ff5c5ecbdbbeef',
  27. 'user_fullname': 'right',
  28. 'user_name': 'right@ppmessage.com',
  29. 'createtime': '2016-05-17 10:53:07 000000',
  30. 'user_email': 'right@ppmessage.com'
  31. },
  32. {
  33. 'user_status': 'SERVICE',
  34. 'updatetime': '2016-05-18 08:15:16 552382',
  35. 'uuid': 'a7341f62-1cd0-11e6-950f-0242ac110002',
  36. 'is_anonymous_user': 'False',
  37. 'user_password': '40bd001563085fc35165329ea1ff5c5ecbdbbeef',
  38. 'user_fullname': 'gitar',
  39. 'user_name': 'gitar@ppmessage.com',
  40. 'createtime': '2016-05-18 08:15:16 552382',
  41. 'user_email': 'gitar@ppmessage.com'
  42. }
  43. ],
  44. 'error_code': 0,
  45. 'uri': '/PP_GET_NO_GROUP_USER_LIST',
  46. 'error_string': 'success.'
  47. }

获取客服组的对话

PPCom调用此API接口来获取某个客服组下,与当前PPCom用户关联的对话。

  1. POST /PP_GET_ORG_GROUP_CONVERSATION

api_level:

  1. PPCOM

参数

NameTypeDescription
app_uuidstring客服团队uuid
group_uuidstring客服组uuid
user_uuidstring用户uuid,此用户是PPCom用户

返回结果(例子)

  1. {
  2. 'conversation_uuid': '68a2feca-1c1d-11e6-a4dd-0242ac110002',
  3. 'error_code': 0,
  4. 'uri': '/PP_GET_NO_GROUP_USER_LIST',
  5. 'error_string': 'success.'
  6. }

更新对话成员

  1. POST /PP_UPDATE_CONVERSATION_MEMBER

api_level:

  1. PPCOM, PPKEFU, THIRD_PARTY_KEFU

参数

NameTypeDescription
app_uuidstring客服团队uuid
conversation_uuidstring用户uuid,此用户是PPCom用户
group_uuidstring客服组uuid,设定此对话与那个客服组关联
actionstring操作类型,添加为”ADD”, 删除为”REMOVE”
member_listlist需要添加或者删除的成员列表

返回结果(例子)

  1. {
  2. 'error_code': 0,
  3. 'error_string': 'success.',
  4. 'uri': '/PP_UPDATE_CONVERSATION_MEMBER'
  5. }

获取默认对话

PPCom调用此API来获取默认对话。

  1. POST /PPCOM_GET_DEFAULT_CONVERSATION

api_level:

  1. PPCOM

参数

NameTypeDescription
app_uuidstring客服团队uuid
user_uuidstring用户uuid,此用户是PPCom用户
device_uuidstring用户设备uuid,此用户是PPCom用户

返回结果(例子)

  1. {
  2. 'status': 'OPEN',
  3. 'conversation_type': 'P2S',
  4. 'app_name': 'ppmessage',
  5. 'latest_task': '771d934d-9629-46df-d635-380858dd114a',
  6. 'conversation_icon': 'http://127.0.0.1:8080/identicon/be625d18d0b96a0b2e2e26c95a4b59e1625348ab.png',
  7. 'group_uuid': None,
  8. 'updatetime': datetime.datetime(2016, 5, 18, 4, 43, 55, 628687),
  9. 'app_welcome': 'xe6x9cx89xe4xbbx80xe4xb9x88xe5x8fxafxe4xbbxa5xe5xb8xaexe5xbfx99xe7x9ax84xefxbcx8cxe4xb8x80xe8xb5xb7xe8x81x8axe4xb8xa4xe5x8fxa5xe5x90xa7xefxbcx9f',
  10. 'uuid': '1efd668e-1cb3-11e6-93e2-0242ac110002',
  11. 'error_string': 'success.',
  12. 'user_uuid': '9adb1032-1cac-11e6-bce9-0242ac110002',
  13. 'uri': '/PPCOM_GET_DEFAULT_CONVERSATION',
  14. 'user_list': [
  15. {
  16. 'updatetime': 1463563427,
  17. 'group': None,
  18. 'uuid': '9adb1032-1cac-11e6-bce9-0242ac110002',
  19. 'user_fullname': 'Unknown Area.User',
  20. 'user_icon': 'http://127.0.0.1:8080/identicon/9adb1032-1cac-11e6-bce9-0242ac110002.png',
  21. 'is_browser_online': False,
  22. 'user_signature': None,
  23. 'is_mobile_online': False,
  24. 'user_email': '9adb10@1ca35f'
  25. },
  26. {
  27. 'updatetime': 1463547414,
  28. 'group': None,
  29. 'uuid': '1ca235d4-17f1-11e6-9d01-0242ac110003',
  30. 'user_fullname': 'Jin He',
  31. 'user_icon': '01a17ddc-1821-11e6-9b56-0242ac110003',
  32. 'is_browser_online': True,
  33. 'user_signature': 'fight to the death ~',
  34. 'is_mobile_online': False,
  35. 'user_email': 'jin.he@ppmessage.com'
  36. },
  37. {
  38. 'updatetime': 1463482387,
  39. 'group': None,
  40. 'uuid': '89d63aee-1c1d-11e6-a4dd-0242ac110002',
  41. 'user_fullname': 'right',
  42. 'user_icon': None,
  43. 'is_browser_online': False,
  44. 'user_signature': None,
  45. 'is_mobile_online': False,
  46. 'user_email': 'right@ppmessage.com'
  47. }
  48. ],
  49. 'app_uuid': '1ca35f40-17f1-11e6-9d01-0242ac110003',
  50. 'conversation_name': 'Jin He,right',
  51. 'assigned_uuid': None,
  52. 'error_code': 0,
  53. 'createtime': datetime.datetime(2016, 5, 18, 4, 43, 52, 603049)
  54. }

按组策略选择可加入到某个对话中的用户

  1. POST /PP_SELECT_USERS_BY_GROUP_ALGORITHM

api_level:

  1. PPCOM, PPKEFU, PPCONSOLE, THIRD_PARTY_KEFU, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid
group_uuidstring客服组uuid
conversation_uuidstring对话uuid

返回结果(例子)

  1. {
  2. 'list': [
  3. '1ca235d4-17f1-11e6-9d01-0242ac110003',
  4. '89d63aee-1c1d-11e6-a4dd-0242ac110002'
  5. ],
  6. 'error_code': 0,
  7. 'uri': '/PP_SELECT_USERS_BY_GROUP_ALGORITHM',
  8. 'error_string': 'success.'
  9. }

更新客服团队信息

  1. POST /PP_UPDATE_APP_INFO

api_level:

  1. PPCONSOLE, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid
app_namestring客服团队名称
app_iconstring客服团队头像
app_route_policystring客户团队消息分发策略, 可为”ALL”, “SMART”, “GROUP”
welcome_messagestringPPCom显示的欢迎信息
ppcom_launcher_colorstringPPCom图标颜色
ppcom_launcher_stylestringPPCom图标样式

返回结果(例子)

  1. {
  2. 'return_offline_message': None,
  3. 'app_name': 'ppmessage123',
  4. 'robot_train_click': None,
  5. 'app_secret': 'Mzg2ODliNjVlY2I2NzBlNTExMmJkMTE4YzM3MjRlMjUxN2U1MjEwMg==',
  6. 'robot_user_uuid': None,
  7. 'app_key': 'NjZlZGNiMGEzOTg4NmNjYWQ2NDIxNDZiN2ZiZTljZTA1NTFiZjdlNw==',
  8. 'ppcom_powered_by_visible': None,
  9. 'robot_train_method': None,
  10. 'api_uuid': '1ca64836-17f1-11e6-9d01-0242ac110003',
  11. 'ppcom_launcher_style': None,
  12. 'robot_train_track': None,
  13. 'show_ppcom_hover': None,
  14. 'ppcom_powered_by_name': None,
  15. 'app_billing_email': None,
  16. 'updatetime': datetime.datetime(2016, 5, 18, 9, 57, 22, 455405),
  17. 'app_route_policy': None,
  18. 'uuid': '1ca35f40-17f1-11e6-9d01-0242ac110003',
  19. 'error_string': 'success.',
  20. 'welcome_message': None,
  21. 'user_uuid': '1ca235d4-17f1-11e6-9d01-0242ac110003',
  22. 'app_icon': None,
  23. 'uri': '/PP_UPDATE_APP_INFO',
  24. 'createtime': datetime.datetime(2016, 5, 12, 3, 25, 1),
  25. 'ppcom_powered_by_link': None,
  26. 'robot_train_chat': None,
  27. 'company_name': 'YOURUI',
  28. 'app_billing_uuid': None,
  29. 'error_code': 0,
  30. 'offline_message': None,
  31. 'ppcom_launcher_color': None
  32. }

获取某用户拥有的客服团队

  1. POST /PP_GET_APP_OWNED_BY_USER

api_level:

  1. PPCOM, PPKEFU, PPCONSOLE, THIRD_PARTY_KEFU, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
user_uuidstring客服团队uuid

返回结果(例子)

  1. {
  2. 'app': {
  3. 'return_offline_message': None,
  4. 'app_name': 'ppmessage123',
  5. 'app_secret': 'Mzg2ODliNjVlY2I2NzBlNTExMmJkMTE4YzM3MjRlMjUxN2U1MjEwMg==',
  6. 'robot_user_uuid': None,
  7. 'api_uuid': '1ca64836-17f1-11e6-9d01-0242ac110003',
  8. 'robot_train_track': None,
  9. 'app_billing_email': None,
  10. 'uuid': '1ca35f40-17f1-11e6-9d01-0242ac110003',
  11. 'welcome_message': None,
  12. 'robot_train_click': None,
  13. 'ppcom_powered_by_visible': None,
  14. 'ppcom_powered_by_link': None,
  15. 'company_name': 'YOURUI',
  16. 'ppcom_launcher_style': None,
  17. 'ppcom_powered_by_name': None,
  18. 'app_icon': None,
  19. 'offline_message': None,
  20. 'app_key': 'NjZlZGNiMGEzOTg4NmNjYWQ2NDIxNDZiN2ZiZTljZTA1NTFiZjdlNw==',
  21. 'show_ppcom_hover': None,
  22. 'updatetime': datetime.datetime(2016, 5, 18, 9, 57, 22, 455405),
  23. 'app_route_policy': None,
  24. 'robot_train_method': None,
  25. 'robot_train_chat': None,
  26. 'app_billing_uuid': None,
  27. 'user_uuid': '1ca235d4-17f1-11e6-9d01-0242ac110003',
  28. 'createtime': datetime.datetime(2016, 5, 12, 3, 25, 1),
  29. 'ppcom_launcher_color': None
  30. },
  31. 'bill': None,
  32. 'error_code': 0,
  33. 'uri': '/PP_GET_APP_OWNED_BY_USER',
  34. 'error_string': 'success.'
  35. }

验证邮箱是否有效

  1. POST /PP_IS_EMAIL_VALID

api_level:

  1. PPCONSOLE, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
user_emailstring客服团队uuid

返回结果(例子)

  1. {
  2. 'valid': False,
  3. 'uri': '/PP_IS_EMAIL_VALID',
  4. 'error_code': 0,
  5. 'error_string': 'success.'
  6. }

创建客服团队

  1. POST /PP_CREATE_APP

api_level:

  1. PPCONSOLE, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
user_uuidstring用户uuid,用户是客服团队的创建者,同时也是管理员
app_namestring客服团队名称

返回结果(例子)

  1. {
  2. 'uri': '/PP_CREATE_APP',
  3. 'error_code': 0,
  4. 'error_string': 'success.',
  5. 'uuid': '82baa504-1ce2-11e6-b4ca-0242ac110002',
  6. 'app_name': 'nodejs',
  7. 'app_billing_email': 'nodejs@ppmessage.com',
  8. 'app_key': '82baa324-1ce2-11e6-b4ca-0242ac110002',
  9. 'app_secret': '82baa464-1ce2-11e6-b4ca-0242ac110002',
  10. 'app_route_policy': 'BROADCAST'
  11. }

将客服移出客服团队

  1. POST /PP_LEAVE_APP

api_level:

  1. PPCONSOLE, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid
user_listlist要移除的客服列表

返回结果(例子)

  1. {
  2. 'uri': '/PP_LEAVE_APP',
  3. 'error_code': 0,
  4. 'error_string': 'success.'
  5. }

删除客服团队

  1. POST /PP_REMOVE_APP

api_level:

  1. PPCONSOLE, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid
user_uuidstring该客服团队的所有者uuid

返回结果(例子)

  1. {
  2. 'uri': '/PP_REMOVE_APP',
  3. 'error_code': 0,
  4. 'error_string': 'success.'
  5. }

获取对话成员列表

  1. POST /PP_GET_CONVERSATION_USER_LIST

api_level:

  1. PPCOM, PPKEFU, PPCONSOLE, THIRD_PARTY_KEFU, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid
conversation_uuidstring对话uuid

返回结果(例子)

  1. {
  2. 'list': [
  3. {
  4. 'updatetime': datetime.datetime(2016, 5, 18, 9, 39, 50, 243510),
  5. 'group': {
  6. 'uuid': '71a93470-1cdc-11e6-bdfe-0242ac110002',
  7. 'group_name': 'Dancer Club'
  8. },
  9. 'uuid': '1ca235d4-17f1-11e6-9d01-0242ac110003',
  10. 'user_fullname': 'Jin He',
  11. 'user_icon': '01a17ddc-1821-11e6-9b56-0242ac110003',
  12. 'is_browser_online': True,
  13. 'user_signature': 'fight to the death ~',
  14. 'is_mobile_online': False,
  15. 'user_email': 'jin.he@ppmessage.com'
  16. },
  17. {
  18. 'updatetime': datetime.datetime(2016, 5, 17, 10, 53, 7),
  19. 'group': {
  20. 'uuid': '71a93470-1cdc-11e6-bdfe-0242ac110002',
  21. 'group_name': 'Dancer Club'
  22. },
  23. 'uuid': '89d63aee-1c1d-11e6-a4dd-0242ac110002',
  24. 'user_fullname': 'right',
  25. 'user_icon': None,
  26. 'is_browser_online': False,
  27. 'user_signature': None,
  28. 'is_mobile_online': False,
  29. 'user_email': 'right@ppmessage.com'
  30. },
  31. {
  32. 'updatetime': datetime.datetime(2016, 5, 18, 9, 23, 47, 399007),
  33. 'group': None,
  34. 'uuid': '9adb1032-1cac-11e6-bce9-0242ac110002',
  35. 'user_fullname': 'Unknown Area.User',
  36. 'user_icon': 'http://127.0.0.1:8080/identicon/9adb1032-1cac-11e6-bce9-0242ac110002.png',
  37. 'is_browser_online': False,
  38. 'user_signature': None,
  39. 'is_mobile_online': False,
  40. 'user_email': '9adb10@1ca35f'
  41. }
  42. ],
  43. 'error_code': 0,
  44. 'uri': '/PP_GET_CONVERSATION_USER_LIST',
  45. 'error_string': 'success.'
  46. }

按页获取某个用户的对话

POST /PP_PAGE_USER_CONVERSATION

api_level:

PPCOM, PPKEFU, THIRD_PARTY_KEFU

参数

NameTypeDescription
app_uuidstring客服团队uuid
user_uuidstring用户uuid
page_offsetnumber页码索引,按页获取时需提供此参数
page_sizenumber每页对话数目,按页获取时需提供此参数
min_uuidstring最旧一个对话的uuid,按uuid范围获取时需提供此参数
max_uuidstring最新一个对话的uuid,按uuid范围获取时需提供此参数

返回结果(例子)

{
    'list': [
        {
            'status': 'OPEN',
            'conversation_type': 'P2S',
            'updatetime': '2016-05-18 04:43:55 628687',
            'uuid': '1efd668e-1cb3-11e6-93e2-0242ac110002',
            'latest_message': {
                'message_body': '{
                    "ci": "1efd668e-1cb3-11e6-93e2-0242ac110002",
                    "ft": "DU",
                    "tt": "AP",
                    "bo": "hi",
                    "ts": 1463546635.627932,
                    "mt": "NOTI",
                    "tl": null,
                    "ms": "TEXT",
                    "ti": "1efd668e-1cb3-11e6-93e2-0242ac110002",
                    "fi": "9adb1032-1cac-11e6-bce9-0242ac110002",
                    "id": "771d934d-9629-46df-d635-380858dd114a",
                    "ct": "P2S"
                }',
                'body': 'hi',
                'updatetime': '2016-05-18 04:43:55 662741',
                'uuid': '771d934d-9629-46df-d635-380858dd114a',
                'from_uuid': '9adb1032-1cac-11e6-bce9-0242ac110002',
                'from_type': 'DU',
                'message_subtype': 'TEXT',
                'conversation_type': 'P2S',
                'message_type': 'NOTI',
                'createtime': '2016-05-18 04:43:55 627932'
            },
            'latest_task': '771d934d-9629-46df-d635-380858dd114a',
            'conversation_data': {
                'updatetime': '2016-05-18 04:43:55 631181',
                'uuid': '1efdcee4-1cb3-11e6-93e2-0242ac110002',
                'conversation_uuid': '1efd668e-1cb3-11e6-93e2-0242ac110002',
                'conversation_icon': 'http://127.0.0.1:8080/identicon/9adb1032-1cac-11e6-bce9-0242ac110002.png',
                'createtime': '2016-05-18 04:43:52 605386',
                'app_uuid': '1ca35f40-17f1-11e6-9d01-0242ac110003',
                'conversation_name': 'Unknown Area.User',
                'user_uuid': '1ca235d4-17f1-11e6-9d01-0242ac110003',
                'conversation_status': 'OPEN'
            },
            'app_uuid': '1ca35f40-17f1-11e6-9d01-0242ac110003',
            'from_user': {
                'user_fullname': 'Unknown Area.User',
                'user_email': '9adb10@1ca35f',
                'user_icon': 'http://127.0.0.1:8080/identicon/9adb1032-1cac-11e6-bce9-0242ac110002.png',
                'uuid': '9adb1032-1cac-11e6-bce9-0242ac110002'
            },
            'user_uuid': '9adb1032-1cac-11e6-bce9-0242ac110002',
            'createtime': '2016-05-18 04:43:52 603049'
        }
    ],
    'return_count': 1,
    'error_string': 'success.',
    'max_uuid': None,
    'total_count': 1,
    'uri': '/PP_PAGE_USER_CONVERSATION',
    'page_size': 15,
    'min_uuid': None,
    'page_offset': 0,
    'error_code': 0
}

按页获取对话历史消息

POST /PP_PAGE_HISTORY_MESSAGE

api_level:

PPCOM, PPKEFU, PPCONSOLE, THIRD_PARTY_KEFU, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
conversation_uuidstring对话uuid
page_offsetnumber页码索引,如果按页获取需要提供此参数
page_sizenumber每页消息数目,如果按页获取需要提供此参数
min_uuidstring最旧一条消息uuid
max_uuidstring最新一条消息uuid

返回结果(例子)

{
    'return_count': 1,
    'error_string': 'success.',
    'total_count': 1L,
    'list': [
        {
            'message_body': '{
                "ci": "1efd668e-1cb3-11e6-93e2-0242ac110002",
                "ft": "DU",
                "tt": "AP",
                "bo": "hi",
                "ts": 1463546635.627932,
                "mt": "NOTI",
                "tl": null,
                "ms": "TEXT",
                "ti": "1efd668e-1cb3-11e6-93e2-0242ac110002",
                "fi": "9adb1032-1cac-11e6-bce9-0242ac110002",
                "id": "771d934d-9629-46df-d635-380858dd114a",
                "ct": "P2S"
            }',
            'conversation_type': 'P2S',
            'updatetime': '2016-05-18 04:43:55 662741',
            'uuid': '771d934d-9629-46df-d635-380858dd114a',
            'message_subtype': 'TEXT',
            'conversation_uuid': '1efd668e-1cb3-11e6-93e2-0242ac110002',
            'from_uuid': '9adb1032-1cac-11e6-bce9-0242ac110002',
            'body': 'hi',
            'from_type': 'DU',
            'from_device_uuid': '9ae44076-1cac-11e6-bce9-0242ac110002',
            'to_type': 'AP',
            'app_uuid': '1ca35f40-17f1-11e6-9d01-0242ac110003',
            'from_user': {
                'user_fullname': 'Unknown Area.User',
                'user_email': '9adb10@1ca35f',
                'user_icon': 'http://127.0.0.1:8080/identicon/9adb1032-1cac-11e6-bce9-0242ac110002.png',
                'uuid': '9adb1032-1cac-11e6-bce9-0242ac110002'
            },
            'to_uuid': '1efd668e-1cb3-11e6-93e2-0242ac110002',
            'task_status': 'PROCESSED',
            'message_type': 'NOTI',
            'createtime': '2016-05-18 04:43:55 627932'
        }
    ],
    'uri': '/PP_PAGE_HISTORY_MESSAGE',
    'page_size': 12,
    'page_offset': 0,
    'error_code': 0
}

按页获取在线的PPCom用户

POST /PP_PAGE_ONLINE_PORTAL_USER

api_level:

PPKEFU, PPCONSOLE, THIRD_PARTY_KEFU, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid
page_offsetnumber页码索引
page_sizenumber每页用户数目

返回结果(例子)



PPKefu用户登录

POST /PPKEFU_LOGIN

api_level:

PPKEFU

参数

NameTypeDescription
user_emailstring用户登录邮箱
terminalstring登录设备uuid
ostypestring登录设备操作系统类型
tokenstringiOS设备token
osmodelstring设备model
osversionstring设备操作系统版本
device_fullnamestring设备全称
ios_app_developmentstringiOS APP是否处于开发模式

返回结果(例子)

{
    'app': {
        'return_offline_message': None,
        'app_name': 'ppmessage123',
        'app_secret': 'Mzg2ODliNjVlY2I2NzBlNTExMmJkMTE4YzM3MjRlMjUxN2U1MjEwMg==',
        'robot_user_uuid': None,
        'api_uuid': '1ca64836-17f1-11e6-9d01-0242ac110003',
        'robot_train_track': None,
        'app_billing_email': None,
        'uuid': '1ca35f40-17f1-11e6-9d01-0242ac110003',
        'welcome_message': None,
        'robot_train_click': None,
        'ppcom_powered_by_visible': None,
        'ppcom_powered_by_link': None,
        'company_name': 'YOURUI',
        'ppcom_launcher_style': None,
        'ppcom_powered_by_name': None,
        'app_icon': None,
        'offline_message': None,
        'app_key': 'NjZlZGNiMGEzOTg4NmNjYWQ2NDIxNDZiN2ZiZTljZTA1NTFiZjdlNw==',
        'show_ppcom_hover': None,
        'updatetime': datetime.datetime(2016, 5, 18, 9, 57, 22, 455405),
        'app_route_policy': None,
        'robot_train_method': None,
        'robot_train_chat': None,
        'app_billing_uuid': None,
        'user_uuid': '1ca235d4-17f1-11e6-9d01-0242ac110003',
        'createtime': datetime.datetime(2016, 5, 12, 3, 25, 1),
        'ppcom_launcher_color': None
    },
    'user_language': 'zh_cn',
    'create_status': None,
    'user_wechat': None,
    'mobile_device_uuid': None,
    'user_company': None,
    'user_status': 'ADMIN',
    'ppcom_browser_device_uuid': None,
    'mqtt_topic': '68a2feca-1c1d-11e6-a4dd-0242ac110002/#',
    'uuid': '1ca235d4-17f1-11e6-9d01-0242ac110003',
    'user_lastname': 'He',
    'user_firstname': 'Jin',
    'user_qq': None,
    'user_icon': '01a17ddc-1821-11e6-9b56-0242ac110003',
    'user_defined': None,
    'user_mobile': None,
    'user_signature': 'fight to the death ~',
    'is_email_verified': None,
    'browser_device_uuid': '68a2feca-1c1d-11e6-a4dd-0242ac110002',
    'user_name': None,
    'is_anonymous_user': False,
    'service_user_status': 'READY',
    'ppcom_trace_uuid': None,
    'user_show_badge': None,
    u'is_owner_user': True,
    'user_mute_other_mobile_device': None,
    'latest_send_message_time': datetime.datetime(2016, 5, 12, 10, 1, 18),
    u'is_service_user': True,
    'updatetime': 1463571257,
    'user_silence_notification': None,
    'is_mobile_verified': None,
    'error_string': 'success.',
    'user_fullname': 'Jin He',
    'uri': '/PPKEFU_LOGIN',
    'ppcom_mobile_device_uuid': None,
    'user_mute_notification': None,
    u'is_distributor_user': True,
    'error_code': 0,
    'createtime': datetime.datetime(2016, 5, 12, 3, 25, 1),
    'user_email': 'jin.he@ppmessage.com'
}

PPKefu用户退出登录

POST /PPKEFU_LOGOUT

api_level:

PPKEFU

参数

NameTypeDescription
app_uuidstring客服团队uuid
user_uuidstring用户uuid
device_uuidstring设备uuid

返回结果(例子)

{
    'uri': '/PPKEFU_LOGOUT',
    'error_code': 0,
    'error_string': 'success.'
}

获取用户详细信息

POST /PP_GET_USER_DETAIL

api_level:

PPCOM, PPKEFU, PPCONSOLE, THIRD_PARTY_KEFU, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
user_uuidstring用户uuid
return_passwordboolean是否返回用户密码

返回结果(例子)

{
    'user_firstname': 'Jin',
    'user_language': 'zh_cn',
    'create_status': None,
    'user_wechat': None,
    'mobile_device_uuid': None,
    'user_company': None,
    'user_status': 'ADMIN',
    'ppcom_browser_device_uuid': None,
    'uuid': '1ca235d4-17f1-11e6-9d01-0242ac110003',
    'user_lastname': 'He',
    'user_qq': None,
    'user_icon': '01a17ddc-1821-11e6-9b56-0242ac110003',
    'user_defined': None,
    'user_mobile': None,
    'user_signature': 'fight to the death ~',
    'is_email_verified': None,
    'browser_device_uuid': '68a2feca-1c1d-11e6-a4dd-0242ac110002',
    'pinyinname1': u'Jin He',
    'user_name': None,
    'pinyinname0': u'Jin He',
    'is_anonymous_user': False,
    'service_user_status': 'READY',
    'ppcom_trace_uuid': None,
    'user_show_badge': None,
    'user_mute_other_mobile_device': None,
    'latest_send_message_time': datetime.datetime(2016, 5, 18, 11, 17, 23),
    'updatetime': datetime.datetime(2016, 5, 18, 11, 34, 23),
    'user_silence_notification': None,
    'is_mobile_verified': None,
    'error_string': 'success.',
    'user_fullname': 'Jin He',
    'uri': '/PP_GET_USER_DETAIL',
    'ppcom_mobile_device_uuid': None,
    'user_mute_notification': None,
    'error_code': 0,
    'createtime': datetime.datetime(2016, 5, 12, 3, 25, 1),
    'user_email': 'jin.he@ppmessage.com'
}

PPConsole客服管理员退出登录

POST /PPCONSOLE_LOGOUT

api_level:

PPCONSOLE

参数

NameTypeDescription
user_uuidstring用户uuid

返回结果(例子)

{
    'uri': '/PPCONSOLE_LOGOUT',
    'error_code': 0,
    'error_string': 'success.'
}

PPConsole客服注册

注册时会同时创建客服团队。

POST /PPCONSOLE_SIGNUP

api_level:

PPCONSOLE, THIRD_PARTY_CONSOLE, PPCONSOLE_BEFORE_LOGIN

参数

NameTypeDescription
app_uuidstring客服团队uuid
app_namestring客服团队名称
user_emailstring用户登录邮箱
user_fullnamestring用户全称
user_passwordstring用户密码

返回结果(例子)

{
    'app': {
        'app_billing_email': 'cordova@ppmessage.com',
        'app_route_policy': 'BROADCAST',
        'uuid': '10f2cf8e-1e39-11e6-8cec-0242ac110002',
        'app_secret': '10f2ce12-1e39-11e6-8cec-0242ac110002',
        'app_key': '10f2c5fc-1e39-11e6-8cec-0242ac110002',
        'user_uuid': '10f23592-1e39-11e6-8cec-0242ac110002',
        'app_name': u'cordova'
    },
    'error_code': 0,
    'uri': '/PPCONSOLE_SIGNUP',
    'error_string': 'success.',
    'user': {
        'user_status': 'OWNER_2',
        'is_anonymous_user': False,
        'uuid': '10f23592-1e39-11e6-8cec-0242ac110002',
        'user_language': u'English',
        'user_password': u'40bd001563085fc35165329ea1ff5c5ecbdbbeef',
        'user_fullname': u'cordova',
        'user_name': u'cordova@ppmessage.com',
        'user_email': u'cordova@ppmessage.com'
    }
}

PPConsole获取用户数目、消息数目

包括今日用户数,昨日用户数,所有用户数,所有消息数。

POST /PPCONSOLE_GET_OVERVIEW_NUMBER

api_level:

PPCONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid

返回结果(例子)

{
    'error_code': 0,
    'uri': '/PPCONSOLE_GET_OVERVIEW_NUMBER',
    'error_string': 'success.',
    'number': {
        'today_customer': 2,
        'all_customer': 9,
        'all_message': '10',
        'yesterday_customer': 0,
        'agent': 3
    }
}

PPConsole获取实时用户数目

POST /PPCONSOLE_GET_REAL_TIME_CUSTOMER_NUMBER

api_level:

PPCONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid

返回结果(例子)

{
    'error_code': 0,
    'uri': '/PPCONSOLE_GET_REAL_TIME_CUSTOMER_NUMBER',
    'error_string': 'success.',
    'number': [
        {'0': 0}, {'1': 0}, {'2': 0}, {'3': 2}, {'4': 0}, {'5': 0},
        {'6': 0}, {'7': 0}, {'8': 0}, {'9': 0}, {'10': 0}, {'11': 0},
        {'12': 0}, {'13': 0}, {'14': 0}, {'15': 0}, {'16': 0}, {'17': 0},
        {'18': 0}, {'19': 0}, {'20': 0}, {'21': 0}, {'22': 0}, {'23': 0}
    ]
}

PPConsole获取实时消息数目

POST /PPCONSOLE_GET_REAL_TIME_SERVICE_NUMBER

api_level:

PPCONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid

返回结果(例子)

{
    'error_code': 0,
    'uri': '/PPCONSOLE_GET_REAL_TIME_SERVICE_NUMBER',
    'error_string': 'success.',
    'number': [
        {'0': 0}, {'1': 0}, {'2': 0}, {'3': 0}, {'4': 0}, {'5': 0},
        {'6': 0}, {'7': 0}, {'8': 0}, {'9': 0}, {'10': 0}, {'11': 0},
        {'12': 0}, {'13': 0}, {'14': 0}, {'15': 0}, {'16': 0}, {'17': 0},
        {'18': 0}, {'19': 0}, {'20': 0}, {'21': 0}, {'22': 0}, {'23': 0}
    ]
}

PPConsole获取实时消息数目

POST /PPCONSOLE_GET_REAL_TIME_MESSAGE_NUMBER

api_level:

PPCONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid

返回结果(例子)

{
    'error_code': 0,
    'uri': '/PPCONSOLE_GET_REAL_TIME_MESSAGE_NUMBER',
    'error_string': 'success.',
    'number': [
        {'0': None}, {'1': None}, {'2': None}, {'3': None}, {'4': None}, {'5': None},
        {'6': None}, {'7': None}, {'8': None}, {'9': None}, {'10': None}, {'11': None},
        {'12': None}, {'13': None}, {'14': None}, {'15': None}, {'16': None}, {'17': None},
        {'18': None}, {'19': None}, {'20': None}, {'21': None}, {'22': None}, {'23': None}
    ]
}

PPConsole获取某段日期内每天的用户数目

POST /PPCONSOLE_GET_CUSTOMER_NUMBER_BY_RANGE"

api_level:

PPCONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid

返回结果(例子)

{
    'error_code': 0,
    'uri': '/PPCONSOLE_GET_CUSTOMER_NUMBER_BY_RANGE',
    'error_string': 'success.',
    'number': {
        '2016-05-19': 0, '2016-05-18': 0, '2016-05-17': 0, '2016-05-16': 0, '2016-05-15': 0, '2016-05-14': 0,
        '2016-05-13': 0, '2016-05-12': 0, '2016-05-11': 0, '2016-05-10': 0, '2016-04-29': 0, '2016-04-28': 0,
        '2016-04-21': 0, '2016-04-20': 0, '2016-04-23': 0, '2016-04-22': 0, '2016-04-25': 0, '2016-04-24': 0,
        '2016-04-27': 0, '2016-04-26': 0, '2016-05-08': 0, '2016-05-09': 0, '2016-05-01': 0, '2016-05-02': 0,
        '2016-05-03': 0, '2016-05-04': 0, '2016-05-05': 0, '2016-05-06': 0, '2016-05-07': 0, '2016-05-20': 2,
        '2016-04-30': 0
    }
}

PPConsole获取某段时期内每天的客服数目

POST /PPCONSOLE_GET_SERVICE_NUMBER_BY_RANGE"

api_level:

PPCONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid

返回结果(例子)

{
    'error_code': 0,
    'uri': '/PPCONSOLE_GET_SERVICE_NUMBER_BY_RANGE',
    'error_string': 'success.',
    'number': {
        '2016-05-19': 0, '2016-05-18': 0, '2016-05-17': 0, '2016-05-16': 0, '2016-05-15': 0, '2016-05-14': 0,
        '2016-05-13': 0, '2016-05-12': 0, '2016-05-11': 0, '2016-05-10': 0, '2016-04-29': 0, '2016-04-28': 0,
        '2016-04-21': 0, '2016-04-20': 0, '2016-04-23': 0, '2016-04-22': 0, '2016-04-25': 0, '2016-04-24': 0,
        '2016-04-27': 0, '2016-04-26': 0, '2016-05-08': 0, '2016-05-09': 0, '2016-05-01': 0, '2016-05-02': 0,
        '2016-05-03': 0, '2016-05-04': 0, '2016-05-05': 0, '2016-05-06': 0, '2016-05-07': 0, '2016-05-20': 2,
        '2016-04-30': 0
    }
}

PPConsole获取某段日期内每天的消息数目

POST /PPCONSOLE_GET_MESSAGE_NUMBER_BY_RANGE"

api_level:

PPCONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid

返回结果(例子)

{
    'error_code': 0,
    'uri': '/PPCONSOLE_GET_MESSAGE_NUMBER_BY_RANGE',
    'error_string': 'success.',
    'number': {
        '2016-05-19': 0, '2016-05-18': 0, '2016-05-17': 0, '2016-05-16': 0, '2016-05-15': 0, '2016-05-14': 0,
        '2016-05-13': 0, '2016-05-12': 0, '2016-05-11': 0, '2016-05-10': 0, '2016-04-29': 0, '2016-04-28': 0,
        '2016-04-21': 0, '2016-04-20': 0, '2016-04-23': 0, '2016-04-22': 0, '2016-04-25': 0, '2016-04-24': 0,
        '2016-04-27': 0, '2016-04-26': 0, '2016-05-08': 0, '2016-05-09': 0, '2016-05-01': 0, '2016-05-02': 0,
        '2016-05-03': 0, '2016-05-04': 0, '2016-05-05': 0, '2016-05-06': 0, '2016-05-07': 0, '2016-05-20': 2,
        '2016-04-30': 0
    }
}

获取客服团队的第三方应用api信息

包括ppkefu_thirdparty 和 ppconsole_thirdparty 信息(api_key, api_secret, api_uuid, api_level)

POST /PP_GET_API_INFO

api_level:

PPCONSOLE, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid
user_uuidstring用户uuid

返回结果(例子)

{
    'ppconsole_thirdparty': {
        'api_secret': u'NTg1YzUzMGE0MDk2ODA2MzUxOGNjMmE1YzczNGViYzg5ZjNhNmIwZg==',
        'api_key': u'ZjU4YzUzYmIzOTI0YWEwMjQ5YmE2ZGEyNzM1MWFiMWQ0OTRjOWViZQ==',
        'api_level': u'THIRD_PARTY_CONSOLE',
        'api_uuid': u'1ca75fc8-17f1-11e6-9d01-0242ac110003'
    },
    'error_code': 0,
    'uri': '/PP_GET_API_INFO',
    'error_string': 'success.',
    'ppkefu_thirdparty': {
        'api_secret': u'ZGVlNmY4NWI1MWJkMzc1NjlkZTJmNWRkYWMxZTZlMjlhOTNkNGY4Yw==',
        'api_key': u'Yzk4ZGNhNjFmYjJiNTgwM2RjNTg1YmQ4MWJkZDUxOGM0YmVmODhjNA==',
        'api_level': u'THIRD_PARTY_KEFU',
        'api_uuid': u'1ca6e7aa-17f1-11e6-9d01-0242ac110003'
    }
}

获取所有客服团队列表

超级管理员可以调用此API接口获取所有客服团队的列表。

POST /PP_GET_ALL_APP_LIST

api_level:

PPCONSOLE, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
user_uuidstring用户uuid

返回结果(例子)

{
    'app': [
        {
            'updatetime': '2016-05-18 09:57:22 000000',
            'uuid': '1ca35f40-17f1-11e6-9d01-0242ac110003',
            'app_secret': 'Mzg2ODliNjVlY2I2NzBlNTExMmJkMTE4YzM3MjRlMjUxN2U1MjEwMg==',
            'app_key': 'NjZlZGNiMGEzOTg4NmNjYWQ2NDIxNDZiN2ZiZTljZTA1NTFiZjdlNw==',
            'company_name': 'YOURUI',
            'api_uuid': '1ca64836-17f1-11e6-9d01-0242ac110003',
            'user_uuid': '1ca235d4-17f1-11e6-9d01-0242ac110003',
            'createtime': '2016-05-12 03:25:01 000000',
            'app_name': 'ppmessage123'
        },
        {
            'app_billing_email': 'nodejs@ppmessage.com',
            'updatetime': '2016-05-18 10:23:09 000000',
            'app_route_policy': 'BROADCAST',
            'uuid': '82baa504-1ce2-11e6-b4ca-0242ac110002',
            'app_secret': '82baa464-1ce2-11e6-b4ca-0242ac110002',
            'app_key': '82baa324-1ce2-11e6-b4ca-0242ac110002',
            'user_uuid': '82b514ea-1ce2-11e6-b4ca-0242ac110002',
            'createtime': '2016-05-18 10:23:09 000000',
            'app_name': 'nodejs'
        },
        {
            'app_billing_email': 'cordova@ppmessage.com',
            'updatetime': '2016-05-20 03:15:12 770747',
            'app_route_policy': 'BROADCAST',
            'uuid': '10f2cf8e-1e39-11e6-8cec-0242ac110002',
            'app_secret': '10f2ce12-1e39-11e6-8cec-0242ac110002',
            'app_key': '10f2c5fc-1e39-11e6-8cec-0242ac110002',
            'user_uuid': '10f23592-1e39-11e6-8cec-0242ac110002',
            'createtime': '2016-05-20 03:15:12 770747',
            'app_name': 'cordova'
        },
        {
            'app_billing_email': 'dancer@ppmessage.com',
            'updatetime': '2016-05-17 09:16:34 000000',
            'app_route_policy': 'BROADCAST',
            'uuid': '0b4693e8-1c10-11e6-b5ef-0242ac110002',
            'app_secret': '0b46933e-1c10-11e6-b5ef-0242ac110002',
            'app_key': '0b469212-1c10-11e6-b5ef-0242ac110002',
            'user_uuid': '0b4629f8-1c10-11e6-b5ef-0242ac110002',
            'createtime': '2016-05-17 09:16:34 000000',
            'app_name': 'dancer-team'
        }
    ],
    'error_code': 0,
    'uri': '/PP_GET_ALL_APP_LIST',
    'error_string': 'success.'
}

验证某设备是否在线

POST /PP_VALIDATE_ONLINE_DEVICE

api_level:

PPKEFU, THIRD_PARTY_KEFU

参数

NameTypeDescription
user_uuidstring用户uuid
device_uuidstring设备uuid

返回结果(例子)

{
    'valid': False,
    'error_code': 0,
    'error_string': 'success.',
    'uri': '/PP_VALIDATE_ONLINE_DEVICE'
}

设置客服状态

POST /PPKEFU_SET_SERVICE_USER_STATUS

api_level:

PPKEFU, THIRD_PARTY_KEFU

参数

NameTypeDescription
app_uuidstring客服团队uuid
user_uuidstring用户uuid
user_statusstring用户状态

返回结果(例子)

{
    'error_code': 0,
    'error_string': 'success.',
    'uri': '/PP_SET_SERVICE_USER_STATUS',
}

获取客服团队下所有预定义问答

预定义问答即事先设置好某个问题的答案。

POST /PP_GET_ALL_PREDEFINED_SCRIPT

api_level:

PPKEFU, PPCONSOLE, THIRD_PARTY_KEFU, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid

返回结果(例子)

{
    'error_code': 0,
    'uri': '/PP_GET_ALL_PREDEFINED_SCRIPT',
    'error_string': 'success.',
    'list': [
        '0b469212-1c10-11e6-b5ef-0242ac110002',
        '0b4629f8-1c10-11e6-b5ef-0242ac110002'
    ]
}

获取客服团队下所有预定义问答组

预定义问答即事先设置好某个问题的答案,一个问答组包括数个预定义问答。

POST /PP_GET_ALL_PREDEFINED_SCRIPT_GROUP

api_level:

PPKEFU, PPCONSOLE, THIRD_PARTY_KEFU, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid

返回结果(例子)

{
    'error_code': 0,
    'uri': '/PP_GET_ALL_PREDEFINED_SCRIPT_GROUP',
    'error_string': 'success.',
    'list': [
        {
            'uuid': '10f2c5fc-1e39-11e6-8cec-0242ac110002',
            'app_uuid': '10f2cf8e-1e39-11e6-8cec-0242ac110002',
            'group_name': 'install instruction',
            'createtime': '2016-05-17 09:16:34 000000',
            'updatetime': '2016-05-17 09:16:34 000000'
        }
    ]
}

获取客服团队某个问答组的所有预定义问答

预定义问答即事先设置好某个问题的答案。一个问答组包括数个预定义问答。

POST /PP_GET_PREDEFINED_SCRIPT_WITH_GROUP

api_level:

PPKEFU, PPCONSOLE, THIRD_PARTY_KEFU, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid
group_uuidstring问答组uuid

返回结果(例子)

{
    'error_code': 0,
    'uri': '/PP_GET_PREDEFINED_SCRIPT_WITH_GROUP',
    'error_string': 'success.',
    'list': [
        {
            'uuid': '1ca64836-17f1-11e6-9d01-0242ac110003',
            'app_uuid': '1ca235d4-17f1-11e6-9d01-0242ac110003',
            'group_uuid': '82baa464-1ce2-11e6-b4ca-0242ac110002',
            'script_question': 'is PPMessage an open source project ?',
            'script_answer': 'Yes, it is.'
        }
    ]
}

添加预定义问答

预定义问答即事先设置好某个问题的答案。

POST /PP_ADD_PREDEFINED_SCRIPT

api_level:

PPKEFU, PPCONSOLE, THIRD_PARTY_KEFU, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid
group_uuidstring问答组uuid
script_questionstring预定义问答的问题
script_answerstring预定义问答的答案

返回结果(例子)

{
    'error_code': 0,
    'uri': '/PP_ADD_PREDEFINED_SCRIPT',
    'error_string': 'success.',
    'uuid': '1ca64836-17f1-11e6-9d01-0242ac110003',
    'app_uuid': '1ca235d4-17f1-11e6-9d01-0242ac110003',
    'group_uuid': '82baa464-1ce2-11e6-b4ca-0242ac110002',
    'script_question': 'is PPMessage an open source project ?',
    'script_answer': 'Yes, it is.'
}

删除预定义问答

预定义问答即事先设置好某个问题的答案。

POST /PP_REMOVE_PREDEFINED_SCRIPT

api_level:

PPKEFU, PPCONSOLE, THIRD_PARTY_KEFU, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid
script_uuidstring问答uuid

返回结果(例子)

{
    'error_code': 0,
    'uri': '/PP_REMOVE_PREDEFINED_SCRIPT',
    'error_string': 'success.',
}

添加预定义问答组

预定义问答即事先设置好某个问题的答案,一个问答组包括数个预定义问答。

POST /PP_ADD_PREDEFINED_SCRIPT_GROUP

api_level:

PPCONSOLE, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid
group_namestring问答组名称

返回结果(例子)

{
    'error_code': 0,
    'uri': '/PP_ADD_PREDEFINED_SCRIPT_GROUP',
    'error_string': 'success.',
    'uuid': '10f2c5fc-1e39-11e6-8cec-0242ac110002',
    'app_uuid': '10f2cf8e-1e39-11e6-8cec-0242ac110002',
    'group_name': 'install instruction',
    'createtime': '2016-05-17 09:16:34 000000',
    'updatetime': '2016-05-17 09:16:34 000000'
}

删除预定义问答组

预定义问答即事先设置好某个问题的答案,一个问答组包括数个预定义问答。

POST /PP_REMOVE_PREDEFINED_SCRIPT_GROUP

api_level:

PPCONSOLE, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid
group_uuidstring问答组uuid

返回结果(例子)

{
    'error_code': 0,
    'uri': '/PP_REMOVE_PREDEFINED_SCRIPT_GROUP',
    'error_string': 'success.',
}

添加预定义问答到某个问答组

POST /PP_MOVE_PREDEFINED_SCRIPT_INTO_GROUP

api_level:

PPCONSOLE, THIRD_PARTY_CONSOLE

参数

NameTypeDescription
app_uuidstring客服团队uuid
group_uuidstring问答组uuid
script_uuidstring问答uuid

返回结果(例子)

{
    'error_code': 0,
    'uri': '/PP_MOVE_PREDEFINED_SCRIPT_INTO_GROUP',
    'error_string': 'success.',
}

发送修改密码邮件

当用户在登录PPConsole前,修改了密码,调用此接口用邮件通知他。

POST /PPCONSOLE_SEND_NEW_PASSWORD

api_level:

PPCONSOLE_BEFORE_LOGIN

参数

NameTypeDescription
user_emailstring问答组uuid

返回结果(例子)

{
    'error_code': 0,
    'uri': '/PPCONSOLE_SEND_NEW_PASSWORD',
    'error_string': 'success.',
}

发送修改密码邮件

当用户在登录PPConsole前,修改了密码,调用此接口用邮件通知他。

POST /PPCONSOLE_SEND_NEW_PASSWORD

api_level:

PPCONSOLE_BEFORE_LOGIN

参数

NameTypeDescription
user_emailstring问答组uuid

返回结果(例子)

{
    'error_code': 0,
    'uri': '/PPCONSOLE_SEND_NEW_PASSWORD',
    'error_string': 'success.',
}

取消等待创建对话

PPCom在等待后台创建对话过程中,可以调用此接口取消等待。

POST /PP_CANCEL_WAITING_CREATE_CONVERSATION

api_level:

PPCOM

参数

NameTypeDescription
app_uuidstring客服团队uuid
user_uuidstring用户uuid
device_uuidstring设备uuid
group_uuidstring对话对应的客服组uuid

返回结果(例子)

{
    'error_code': 0,
    'uri': '/PP_CANCEL_WAITING_CREATE_CONVERSATION',
    'error_string': 'success.',
}

PPCom创建对话

客服团队的消息分配策略不同,PPCom创建对话的方式也不同。

POST /PPCOM_CREATE_CONVERSATION

api_level:

PPCOM

参数

NameTypeDescription
app_uuidstring客服团队uuid
user_uuidstring用户uuid
device_uuidstring设备uuid
group_uuidstring客服组uuid
member_listlist对话成员uuid列表

返回结果(例子)

{
    'status': 'NEW',
    'conversation_type': 'P2S',
    'uuid': 'a3e0da04-1e69-11e6-bcf2-0242ac110002',
    'error_string': 'success.',
    'latest_task': None,
    'user_uuid': '9adb1032-1cac-11e6-bce9-0242ac110002',
    'uri': '/PPCOM_CREATE_CONVERSATION',
    'group_uuid': None,
    'conversation_icon': None,
    'app_uuid': '1ca35f40-17f1-11e6-9d01-0242ac110003',
    'conversation_name': 'right@ppmessage.com',
    'assigned_uuid': '89d63aee-1c1d-11e6-a4dd-0242ac110002',
    'error_code': 0,
    'updatetime': datetime.datetime(2016, 5, 20, 9, 2, 55, 134858),
    'createtime': datetime.datetime(2016, 5, 20, 9, 2, 55, 134858)
}

PPCom获取正在等待创建对话的PPCom用户数

POST /PP_GET_AMD_QUEUE_LENGTH

api_level:

PPCOM

参数

NameTypeDescription
app_uuidstring客服团队uuid

返回结果(例子)

{
    'length': 10,
    'uri': '/PPCOM_CREATE_CONVERSATION',
    'error_code': 0,
    'error_string': 'success.'
}