非官方lp数据api包装器
lp-api-wrapper的Python项目详细描述
lp_api_wrapper:非官方的liveperson api python包装器
lp_api_wrapper是一个本地python库,用于与liveperson的api接口。 所有方法都将在本机python数据结构中返回解码的json。
支持以下API:
- 消息交互api
- 对话-1开始日期范围内的数据偏移量
- 所有对话-开始日期范围内的所有数据偏移量
- 按对话ID获取对话
- 按消费者ID获取对话
- 所有对话-开始日期范围内的所有数据偏移量
- 对话-1开始日期范围内的数据偏移量
- 参与历史API
- 约定-1开始日期范围内的数据偏移量
- 所有约定-开始日期范围内的所有数据偏移量
- 约定-1开始日期范围内的数据偏移量
- 代理度量API
- 探员状态
- 摘要
- 消息操作api
- 信息交流
- 消息传送当前队列运行状况
- 消息队列运行状况
- 信息分发
- 操作实时api
- 队列健康
- 参与活动
- 探员活动
- 当前队列状态
- 二语习得直方图
- 预定义内容API
- 获取预定义的内容项
- 预定义类别API
- 类别列表
安装
$ pip install --upgrade lp_api_wrapper
导入lp_api_包装器
# For Messaging Interactions APIfromlp_api_wrapperimportMessagingInteractions# For Engagement History APIfromlp_api_wrapperimportEngagementHistory# For Agent Metrics APIfromlp_api_wrapperimportAgentMetrics# For Messaging Operations APIfromlp_api_wrapperimportMessagingOperations# For Operational Realtime APIfromlp_api_wrapperimportOperationalRealtime# For Predefined Content APIfromlp_api_wrapperimportPredefinedContent# For Predefined Categories APIfromlp_api_wrapperimportPredefinedCategories
登录/身份验证
lp_api_包装器中的每个类都接受用户登录或oauth1身份验证。
通过登录服务API登录: https://developers.liveperson.com/login-getting-started.html
fromlp_api_wrapperimportUserLoginauth=UserLogin(account_id='1234',username='YOURUSERNAME',password='YOURPASSWORD')
或者,使用OAuth1身份验证登录
fromlp_api_wrapperimportOAuthLoginauth=OAuthLogin(account_id='1234',app_key='APP_KEY',app_secret='APP_SECRET',access_token='ACCESS_TOKEN',access_token_secret='ACCESS_TOKEN_SECRET')
消息交互API
创建消息交互连接
fromlp_api_wrapperimportMessagingInteractionsmi_conn=MessagingInteractions(auth=auth)<H4>1。对话
文档:
注意!- 将返回1个数据偏移量。
参数:
- 正文:dict(注意:查看参考以了解详细信息)
- 偏移量:int(默认值:0)
- 限制:int(默认值:100)
- 排序:str(默认:无)
body={'start':{'from':1491004800000,'to':1491091199000}}data=mi_conn.conversations(body)<H4>2。所有对话
文档:
注意!- 将返回所有偏移的数据作为对话列表。
参数:
- 正文:dict(注意:查看参考以了解详细信息)
- max_workers:int(一次最大API请求数。默认值:7)
- 调试:int(API请求的状态:1=完整,2=摘要,默认值=0)
- 解析数据:bool(解析数据并返回一个对话数据对象。默认值:false)
body={'start':{'from':1491004800000,'to':1491091199000}}data=mi_conn.all_conversations(body)<H4>2。按对话ID获取对话
文档:
参数:
- 会话ID:str
data=mi_conn.get_conversation_by_conversation_id(conversation_id='1234abc')<H4>3。获得康威按消费者ID排序
文档:
参数:
- 消费者编号:str
data=mi_conn.get_conversations_by_consumer_id(consumer_id='1234abc')
参与历史API
创建预订历史记录连接。
$ pip install --upgrade lp_api_wrapper0 <H4>1。约定
文档:
注意!- 将返回1个数据偏移量。
参数:
- 正文:dict(注意:查看参考以了解详细信息)
- 偏移量:int(默认值:0)
- 限制:int(默认值:100)
- 排序:str(默认:无)
$ pip install --upgrade lp_api_wrapper1 <H4>2。所有约定
文档:
注意!- 将返回数据的所有偏移作为预订列表。
参数:
- 正文:dict(注意:查看参考以了解详细信息)
- max_workers:int(一次最大API请求数。默认值:7)
- 调试:int(API请求的状态:1=完整,2=摘要,默认值=0)
- 解析数据:bool(解析数据并返回一个engagements数据对象。默认值:false)
$ pip install --upgrade lp_api_wrapper2
代理度量API
创建代理度量连接。
$ pip install --upgrade lp_api_wrapper3 <H4>1。代理状态
文档:
注意!- 如果全部为空,此方法将返回帐户的所有代理的状态。
参数:
- 状态:列表[字符串](默认值:无)
- 代理程序ID:list[str](默认:无)
- 技能ID:list[str](默认值:无)
- 代理程序组ID:list[str](默认:无)
- 代理状态:bool(默认:无)
- 连接状态:列表[字符串](默认值:无)
$ pip install --upgrade lp_api_wrapper4 <H4>2。总结< /H4>
文档:
注意!- 如果全部为空,此方法将返回帐户的状态。
参数:
- 状态:列表[字符串](默认值:无)
- 代理程序ID:list[str](默认:无)
- 技能ID:list[str](默认值:无)
- 代理程序组ID:list[str](默认:无)
$ pip install --upgrade lp_api_wrapper5
消息传递操作API
创建消息操作连接。
$ pip install --upgrade lp_api_wrapper6 <H4>1。消息传递对话
文档:
参数:
- 时间帧:int
- 技能ID:str(默认值:无)
- 代理程序ID:str(默认:无)
- 间隔:int(默认:无)
- 版本:int(默认:1)
$ pip install --upgrade lp_api_wrapper7 <H4>2。消息传递当前队列运行状况
文档
参数:
- 技能ID:str(默认值:无)
- 版本:int(默认:1)
文档
参数:
- 时间帧:int
- 技能ID:str(默认值:无)
- 间隔:int(默认:无)
- 版本:int(默认:1)
$ pip install --upgrade lp_api_wrapper9 <H4>4。信息CSAT分发
文档
参数:
- 时间帧:int
- 技能ID:str(默认值:无)
- 代理程序ID:str(默认:无)
- 版本:int(默认:1)
# For Messaging Interactions APIfromlp_api_wrapperimportMessagingInteractions# For Engagement History APIfromlp_api_wrapperimportEngagementHistory# For Agent Metrics APIfromlp_api_wrapperimportAgentMetrics# For Messaging Operations APIfromlp_api_wrapperimportMessagingOperations# For Operational Realtime APIfromlp_api_wrapperimportOperationalRealtime# For Predefined Content APIfromlp_api_wrapperimportPredefinedContent# For Predefined Categories APIfromlp_api_wrapperimportPredefinedCategories0 <H4>5。消息估计等待时间
文档
参数:
- 技能ID:str(默认值:无)
- 版本:int(默认:1)
# For Messaging Interactions APIfromlp_api_wrapperimportMessagingInteractions# For Engagement History APIfromlp_api_wrapperimportEngagementHistory# For Agent Metrics APIfromlp_api_wrapperimportAgentMetrics# For Messaging Operations APIfromlp_api_wrapperimportMessagingOperations# For Operational Realtime APIfromlp_api_wrapperimportOperationalRealtime# For Predefined Content APIfromlp_api_wrapperimportPredefinedContent# For Predefined Categories APIfromlp_api_wrapperimportPredefinedCategories1
操作实时API
创建可操作的实时连接。
# For Messaging Interactions APIfromlp_api_wrapperimportMessagingInteractions# For Engagement History APIfromlp_api_wrapperimportEngagementHistory# For Agent Metrics APIfromlp_api_wrapperimportAgentMetrics# For Messaging Operations APIfromlp_api_wrapperimportMessagingOperations# For Operational Realtime APIfromlp_api_wrapperimportOperationalRealtime# For Predefined Content APIfromlp_api_wrapperimportPredefinedContent# For Predefined Categories APIfromlp_api_wrapperimportPredefinedCategories2 <H4>1。队列运行状况
文档:
参数:
- 时间帧:int
- 技能ID:str(默认值:无)
- 间隔:int(默认:无)
- 版本:int(默认:1)
# For Messaging Interactions APIfromlp_api_wrapperimportMessagingInteractions# For Engagement History APIfromlp_api_wrapperimportEngagementHistory# For Agent Metrics APIfromlp_api_wrapperimportAgentMetrics# For Messaging Operations APIfromlp_api_wrapperimportMessagingOperations# For Operational Realtime APIfromlp_api_wrapperimportOperationalRealtime# For Predefined Content APIfromlp_api_wrapperimportPredefinedContent# For Predefined Categories APIfromlp_api_wrapperimportPredefinedCategories3 <H4>2。参与活动
文档:
参数:
- 时间帧:int
- 技能ID:str(默认值:无)
- 代理程序ID:str(默认:无)
- 间隔:int(默认:无)
- 版本:int(默认:1)
# For Messaging Interactions APIfromlp_api_wrapperimportMessagingInteractions# For Engagement History APIfromlp_api_wrapperimportEngagementHistory# For Agent Metrics APIfromlp_api_wrapperimportAgentMetrics# For Messaging Operations APIfromlp_api_wrapperimportMessagingOperations# For Operational Realtime APIfromlp_api_wrapperimportOperationalRealtime# For Predefined Content APIfromlp_api_wrapperimportPredefinedContent# For Predefined Categories APIfromlp_api_wrapperimportPredefinedCategories4 <H4>3。代理活动
文档:
参数:
- 时间帧:int
- 探员:str
- 间隔:int(默认:无)
- 版本:int(默认:1)
# For Messaging Interactions APIfromlp_api_wrapperimportMessagingInteractions# For Engagement History APIfromlp_api_wrapperimportEngagementHistory# For Agent Metrics APIfromlp_api_wrapperimportAgentMetrics# For Messaging Operations APIfromlp_api_wrapperimportMessagingOperations# For Operational Realtime APIfromlp_api_wrapperimportOperationalRealtime# For Predefined Content APIfromlp_api_wrapperimportPredefinedContent# For Predefined Categories APIfromlp_api_wrapperimportPredefinedCategories5 <H4>4。当前队列状态
文档:
参数:
- 技能ID:str(默认值:无)
- 版本:int(默认:1)
# For Messaging Interactions APIfromlp_api_wrapperimportMessagingInteractions# For Engagement History APIfromlp_api_wrapperimportEngagementHistory# For Agent Metrics APIfromlp_api_wrapperimportAgentMetrics# For Messaging Operations APIfromlp_api_wrapperimportMessagingOperations# For Operational Realtime APIfromlp_api_wrapperimportOperationalRealtime# For Predefined Content APIfromlp_api_wrapperimportPredefinedContent# For Predefined Categories APIfromlp_api_wrapperimportPredefinedCategories6 <H4>5。sla直方图
文档:
参数:
- 时间帧:int
- 技能ID:str(默认值:无)
- 组ID:str(默认:无)
- 直方图:str(默认:无)
- 版本:int(默认:1)
# For Messaging Interactions APIfromlp_api_wrapperimportMessagingInteractions# For Engagement History APIfromlp_api_wrapperimportEngagementHistory# For Agent Metrics APIfromlp_api_wrapperimportAgentMetrics# For Messaging Operations APIfromlp_api_wrapperimportMessagingOperations# For Operational Realtime APIfromlp_api_wrapperimportOperationalRealtime# For Predefined Content APIfromlp_api_wrapperimportPredefinedContent# For Predefined Categories APIfromlp_api_wrapperimportPredefinedCategories7
预定义内容API
创建预定义的内容连接。
# For Messaging Interactions APIfromlp_api_wrapperimportMessagingInteractions# For Engagement History APIfromlp_api_wrapperimportEngagementHistory# For Agent Metrics APIfromlp_api_wrapperimportAgentMetrics# For Messaging Operations APIfromlp_api_wrapperimportMessagingOperations# For Operational Realtime APIfromlp_api_wrapperimportOperationalRealtime# For Predefined Content APIfromlp_api_wrapperimportPredefinedContent# For Predefined Categories APIfromlp_api_wrapperimportPredefinedCategories8 <H4>1。获取预定义的内容项
文档:
参数:
- 包含已删除:bool(默认值:无)
- 清除数据:bool(默认:无)
- lang:str(默认:无)
- 选择:str(默认:无)
- 分组依据:str(默认:无)
- 技能ID:str(默认值:无)
- id:str(默认:无)
- 版本:float(默认值:2.0)
# For Messaging Interactions APIfromlp_api_wrapperimportMessagingInteractions# For Engagement History APIfromlp_api_wrapperimportEngagementHistory# For Agent Metrics APIfromlp_api_wrapperimportAgentMetrics# For Messaging Operations APIfromlp_api_wrapperimportMessagingOperations# For Operational Realtime APIfromlp_api_wrapperimportOperationalRealtime# For Predefined Content APIfromlp_api_wrapperimportPredefinedContent# For Predefined Categories APIfromlp_api_wrapperimportPredefinedCategories9
预定义类别API
创建预定义的类别连接。
fromlp_api_wrapperimportUserLoginauth=UserLogin(account_id='1234',username='YOURUSERNAME',password='YOURPASSWORD')0 <H4>1。类别列表
文档:
参数:
- 选择:str(默认:无)
- 包含已删除:bool(默认值:无)
- 版本:float(默认值:2.0)
fromlp_api_wrapperimportUserLoginauth=UserLogin(account_id='1234',username='YOURUSERNAME',password='YOURPASSWORD')1