SecondMe API
用户信息
获取用户基本信息、兴趣标签和 Key Memory
用户信息相关接口。
Base URL: https://api.mindverse.com/gate/lab
获取用户信息
获取授权用户的基本信息。
GET /api/secondme/user/info认证
需要 OAuth2 Token。
所需权限
userinfo
请求示例
curl -X GET "https://api.mindverse.com/gate/lab/api/secondme/user/info" \
-H "Authorization: Bearer lba_at_your_access_token"响应
成功 (200)
{
"code": 0,
"data": {
"userId": "12345678",
"name": "用户名",
"email": "user@example.com",
"avatar": "https://cdn.example.com/avatar.jpg",
"bio": "个人简介",
"selfIntroduction": "自我介绍内容",
"profileCompleteness": 85,
"route": "username"
}
}| 字段 | 类型 | 说明 |
|---|---|---|
| userId | string | 用户 ID |
| name | string | 用户姓名 |
| string | 用户邮箱 | |
| avatar | string | 头像 URL |
| bio | string | 个人简介 |
| selfIntroduction | string | 自我介绍 |
| profileCompleteness | number | 资料完整度(0-100) |
| route | string | 用户主页路由 |
错误码
| 错误码 | 说明 |
|---|---|
| apikey.permission.denied | 缺少 userinfo 权限 |
获取用户兴趣标签
获取用户的兴趣标签(仅返回有公开内容的标签)。
GET /api/secondme/user/shades认证
需要 OAuth2 Token。
所需权限
userinfo
请求示例
curl -X GET "https://api.mindverse.com/gate/lab/api/secondme/user/shades" \
-H "Authorization: Bearer lba_at_your_access_token"响应
成功 (200)
{
"code": 0,
"data": {
"shades": [
{
"id": 123,
"shadeName": "科技爱好者",
"shadeIcon": "https://cdn.example.com/icon.png",
"confidenceLevel": "HIGH",
"shadeDescription": "热爱科技",
"shadeDescriptionThirdView": "他/她热爱科技",
"shadeContent": "喜欢编程和数码产品",
"shadeContentThirdView": "他/她喜欢编程和数码产品",
"sourceTopics": ["编程", "AI"],
"shadeNamePublic": "科技达人",
"shadeIconPublic": "https://cdn.example.com/public-icon.png",
"confidenceLevelPublic": "HIGH",
"shadeDescriptionPublic": "科技爱好者",
"shadeDescriptionThirdViewPublic": "一位科技爱好者",
"shadeContentPublic": "热爱科技",
"shadeContentThirdViewPublic": "他/她热爱科技",
"sourceTopicsPublic": ["科技"],
"hasPublicContent": true
}
]
}
}| 字段 | 类型 | 说明 |
|---|---|---|
| shades | array | 兴趣标签列表 |
| shades[].id | number | 标签 ID |
| shades[].shadeName | string | 标签名称 |
| shades[].shadeIcon | string | 标签图标 URL |
| shades[].confidenceLevel | string | 置信度:VERY_HIGH、HIGH、MEDIUM、LOW、VERY_LOW |
| shades[].shadeDescription | string | 标签描述 |
| shades[].shadeDescriptionThirdView | string | 第三人称描述 |
| shades[].shadeContent | string | 标签内容 |
| shades[].shadeContentThirdView | string | 第三人称内容 |
| shades[].sourceTopics | array | 来源主题 |
| shades[].shadeNamePublic | string | 公开标签名称 |
| shades[].shadeIconPublic | string | 公开图标 URL |
| shades[].confidenceLevelPublic | string | 公开置信度 |
| shades[].shadeDescriptionPublic | string | 公开描述 |
| shades[].shadeDescriptionThirdViewPublic | string | 公开第三人称描述 |
| shades[].shadeContentPublic | string | 公开内容 |
| shades[].shadeContentThirdViewPublic | string | 公开第三人称内容 |
| shades[].sourceTopicsPublic | array | 公开来源主题 |
| shades[].hasPublicContent | boolean | 是否有公开内容 |
错误码
| 错误码 | 说明 |
|---|---|
| apikey.permission.denied | 缺少 userinfo 权限 |
搜索 Key Memory
按关键词搜索 Key Memory,支持分页。
GET /api/secondme/memory/key/search?keyword=&pageNo=1&pageSize=20认证
需要 OAuth2 Token。
所需权限
memory.read
查询参数
| 参数 | 类型 | 必需 | 说明 |
|---|---|---|---|
| keyword | string | 否 | 搜索关键词 |
| pageNo | integer | 否 | 页码(默认: 1) |
| pageSize | integer | 否 | 每页大小(默认: 20) |
请求示例
curl -X GET "https://api.mindverse.com/gate/lab/api/secondme/memory/key/search?keyword=阅读&pageNo=1&pageSize=20" \
-H "Authorization: Bearer lba_at_your_access_token"响应
成功 (200)
{
"code": 0,
"data": {
"list": [
{
"id": 12345,
"factActor": "用户",
"factObject": "兴趣爱好",
"factContent": "喜欢在周末阅读科幻小说",
"createTime": 1705315800000,
"updateTime": 1705315800000,
"visibility": 1
}
],
"total": 1
}
}| 字段 | 类型 | 说明 |
|---|---|---|
| list | array | Key Memory 列表 |
| list[].id | number | 记忆 ID |
| list[].factActor | string | 事实主体 |
| list[].factObject | string | 事实对象/分类 |
| list[].factContent | string | 事实内容 |
| list[].createTime | number | 创建时间(毫秒时间戳) |
| list[].updateTime | number | 更新时间(毫秒时间戳) |
| list[].visibility | number | 可见性 |
| total | number | 总数 |
错误码
| 错误码 | 说明 |
|---|---|
| auth.token.invalid | Token 无效或已过期 |