通知 - 私信
登录后调用此接口 ,可获取私信
接口信息
| 项目 | 值 |
|---|---|
| 接口地址 | /msg/private |
| 请求方式 | GET / POST |
| 需要登录 | 是 |
| 对应模块 | msg_private |
| 文档分类 | 社交与消息 |
请求参数
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
limit | number | string | — | 30 | 返回数量,默认为 30 |
offset | number | string | — | 0 | 偏移数量,用于分页,如:(页数 - 1)*30, 其中 30 为 limit 的值,默认为 0 |
HTTP 示例
bash
GET /msg/private?limit=3编程式调用
ts
import { msgPrivate } from 'hana-music-api';
const result = await msgPrivate({
limit: '3',
});
console.log(result.body);返回内容
body.msgs 是私信会话列表,每个会话只收紧自己的编号 msgs[].user.id;会话双方 fromUser、toUser 是附带资料,复用 UserProfile 的字段但把 userId 放宽,另补 expertTags,整个对象按宽松字段处理。lastMsg 是最后一条消息的 JSON 字符串,lastMsgId、lastMsgTime、msgSenderType、newMsgCount、noticeAccountFlag、more 都宽松。offset 越界时返回空数组;未登录时上游返回 code: 200 和空会话列表。结构定义和类型是 MsgPrivateBody。
补充说明
说明 : 登录后调用此接口 ,可获取私信
可选参数 :
limit : 返回数量,默认为 30
offset : 偏移数量,用于分页,如:(页数 - 1)*30, 其中 30 为 limit 的值,默认为 0
接口地址 : /msg/private
调用例子 : /msg/private?limit=3