接口路径(新):http://api.okayapi.com/api/App/Market_ChatMessage/Send
接口路径(旧):http://api.okayapi.com/?s=App.Market_ChatMessage.Send
接口描述: 发送私信,非好友也可以发送。使用前请先安装私信插件
Parameter | Type | Required | Default | Note | Description |
---|---|---|---|---|---|
HTTP_APPKEY | String | Required | MIN: 32 | Common Put Your APPKEY | |
other_uuid | String | Required | MIN: 32;MAX: 32 | 接收私信的会员uuid | |
chat_message_type | Enum | Required | text | Range: text/html/image/link/custom | 私信消息类型,text普通文本,html富文本,image图片,link链接,custom自定义。注意,不同私信类型,需要提供的chat_message_data参数不同。 |
chat_message_data | ArrayJSON Format | Required | 私信消息数据,JSON格式。不同消息类型,参数格式不同。分别是:
|
KEY | Type | Description |
---|---|---|
err_code | Int | 操作码,0表示成功,1不能发送给自己,2发送失败,9表示插件未安装 |
err_msg | String | 错误提示信息,err_code非0时参考此提示信息 |
接口路径(新):http://api.okayapi.com/api/App/Market_ChatMessage/MultiSend
接口路径(旧):http://api.okayapi.com/?s=App.Market_ChatMessage.MultiSend
接口描述: 给多个会员批量群发私信,非好友也可以发送。使用前请先安装私信插件
Parameter | Type | Required | Default | Note | Description |
---|---|---|---|---|---|
HTTP_APPKEY | String | Required | MIN: 32 | Common Put Your APPKEY | |
other_uuid | ArraySeperated with , | Required | MIN: 1;MAX: 200 | 接收私信的会员uuid,多个uuid用英文逗号分割 | |
chat_message_type | Enum | Required | text | Range: text/html/image/link/custom | 私信消息类型,text普通文本,html富文本,image图片,link链接,custom自定义。注意,不同私信类型,需要提供的chat_message_data参数不同。 |
chat_message_data | ArrayJSON Format | Required | 私信消息数据,JSON格式。不同消息类型,参数格式不同。分别是:
|
KEY | Type | Description |
---|---|---|
err_code | Int | 操作码,0表示成功,1不能发送给自己,2发送失败,9表示插件未安装 |
err_msg | String | 错误提示信息,err_code非0时参考此提示信息 |
detail | Array | 批量发送结果详情 |
detail[].other_uuid | String | 接收私信的会员ID |
detail[].chat_message_id | Int | 消息ID |
接口路径(新):http://api.okayapi.com/api/App/Market_ChatMessage/TakeMessageList
接口路径(旧):http://api.okayapi.com/?s=App.Market_ChatMessage.TakeMessageList
接口描述: 获取与某一位会员的单人会话消息列表。使用前请先安装私信插件
Parameter | Type | Required | Default | Note | Description |
---|---|---|---|---|---|
HTTP_APPKEY | String | Required | MIN: 32 | Common Put Your APPKEY | |
other_uuid | String | Required | MIN: 32;MAX: 32 | 私信对话的会员uuid | |
last_id | String | Optaion | 0 | MIN: 0 | 上一次的消息ID,通过传递前面的私信消息ID以保证消息的连贯性。 |
direction | Enum | Optaion | down | Range: up/down | 获取私信消息的方向,up表示向上滑动,即取前面的旧消息;down表示向下滑动,即获取最新的消息。 |
perpage | Int | Optaion | 20 | MIN: 1;MAX: 100 | 分页数量 |
KEY | Type | Description |
---|---|---|
err_code | Int | 操作码,0表示成功,1不能和自己聊天,9表示插件未安装 |
err_msg | String | 错误提示信息,err_code非0时参考此提示信息 |
list | Array | 消息列表 |
list[].id | Int | |
list[].chat_message_to_uuid | String | 当前会话的会员uuid |
list[].chat_message_data | Object | 消息数据结构体 |
list[].chat_message_type | String | 消息类型 |
list[].chat_message_is_read | Int | 是否已读,0未读1已读 |
list[].chat_message_io | String | 消息方向,in表示自己发出的,out表示收到的 |
list[].add_time | String | 消息发送时间 |
unread_num | Int | 未读消息数量 |
接口路径(新):http://api.okayapi.com/api/App/Market_ChatMessage/MarkAsReaded
接口路径(旧):http://api.okayapi.com/?s=App.Market_ChatMessage.MarkAsReaded
接口描述: 可以针对单人会话,把当前会话的全部消息或指定某一条消息置为已读。使用前请先安装私信插件
Parameter | Type | Required | Default | Note | Description |
---|---|---|---|---|---|
HTTP_APPKEY | String | Required | MIN: 32 | Common Put Your APPKEY | |
other_uuid | String | Required | MIN: 32;MAX: 32 | 私信对话的会员uuid | |
chat_message_id | Int | Optaion | 0 | MIN: 0 | 会话消息ID,为0时表示把当前会话全部消息标记为已读,不为0时单条标记为已读。 |
KEY | Type | Description |
---|---|---|
err_code | Int | 操作码,0表示成功,9表示插件未安装 |
err_msg | String | 错误提示信息,err_code非0时参考此提示信息 |
readed_num | Int | 本次已标记为已读的数量 |
接口路径(新):http://api.okayapi.com/api/App/Market_ChatMessage/GetAllChatList
接口路径(旧):http://api.okayapi.com/?s=App.Market_ChatMessage.GetAllChatList
接口描述: 获取和全部人的私信会话列表。使用前请先安装私信插件
Parameter | Type | Required | Default | Note | Description |
---|---|---|---|---|---|
HTTP_APPKEY | String | Required | MIN: 32 | Common Put Your APPKEY | |
page | Int | Optaion | 1 | MIN: 1;MAX: 100 | 第几页 |
perpage | Int | Optaion | 20 | MIN: 1;MAX: 100 | 分页数量 |
请求(需要登录态):
{OKAYAPI_API_HOST}/?s=App.Market_ChatMessage.GetAllChatList&app_key={你的app_key}&sign={动态签名}
返回:
{
"ret": 200,
"data": {
"err_code": 0,
"err_msg": "",
"list": [
{
"chat_message_to_uuid": "8AEA2AF1951C0376EC668A74B8CAA64A",
"chat_message_data": {
"content": "I ❤ ⚽ "
},
"chat_message_type": "text",
"chat_message_is_read": 1,
"chat_message_io": "out",
"add_time": "2019-08-11 17:12:02",
"user": {
"username": "AB君",
"ext_info": {
"yesapi_avatar": "",
"nickname": "",
"age": "18"
}
}
},
{
"chat_message_to_uuid": "5B1CA086F3E9E86F83354191AFB41E9E",
"chat_message_data": {
"content": "I love 小白接口!"
},
"chat_message_type": "text",
"chat_message_is_read": 1,
"chat_message_io": "out",
"add_time": "2019-08-11 17:12:02",
"user": {
"username": "dogstar",
"ext_info": {
"yesapi_avatar": "",
"nickname": "",
"age": "18"
}
}
}
],
"total": 2
},
"msg": "小白开放接口:App.Market_ChatMessage.GetAllChatList"
}
KEY | Type | Description |
---|---|---|
err_code | Int | 操作码,0表示成功,9表示插件未安装 |
err_msg | String | 错误提示信息,err_code非0时参考此提示信息 |
list | Array | 私信聊天列表 |
list[].chat_message_to_uuid | String | 当前会话的会员uuid |
list[].chat_message_type | String | 消息类型 |
list[].chat_message_io | String | 消息方向,in表示自己发出的,out表示收到的 |
list[].add_time | String | 消息发送时间 |
list[].chat_message_data | Object | 消息数据结构体 |
list[].chat_message_is_read | Int | 是否已读,0未读1已读 |
list[].user | Object | 用户信息 |
list[].user.username | String | 用户账号名 |
list[].user.ext_info | Object | 用户扩展信息 |
total | Int | 私信聊天人数 |
接口路径(新):http://api.okayapi.com/api/App/Market_ChatMessage/GetAllUnreadNum
接口路径(旧):http://api.okayapi.com/?s=App.Market_ChatMessage.GetAllUnreadNum
接口描述: 获取和全部人的未读的新消息数量。使用前请先安装私信插件
Parameter | Type | Required | Default | Note | Description |
---|---|---|---|---|---|
HTTP_APPKEY | String | Required | MIN: 32 | Common Put Your APPKEY |
KEY | Type | Description |
---|---|---|
err_code | Int | 操作码,0表示成功,9表示插件未安装 |
err_msg | String | 错误提示信息,err_code非0时参考此提示信息 |
Power by OkayAPI.com Contact us (WA: okayapi OR Email: chanzonghuang@gmail.com).
Timezone: America/New_York Apr/18/2024 22:50:11