SecondMeSecondMe API
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"
  }
}
字段类型说明
userIdstring用户 ID
namestring用户姓名
emailstring用户邮箱
avatarstring头像 URL
biostring个人简介
selfIntroductionstring自我介绍
profileCompletenessnumber资料完整度(0-100)
routestring用户主页路由

错误码

错误码说明
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
      }
    ]
  }
}
字段类型说明
shadesarray兴趣标签列表
shades[].idnumber标签 ID
shades[].shadeNamestring标签名称
shades[].shadeIconstring标签图标 URL
shades[].confidenceLevelstring置信度:VERY_HIGHHIGHMEDIUMLOWVERY_LOW
shades[].shadeDescriptionstring标签描述
shades[].shadeDescriptionThirdViewstring第三人称描述
shades[].shadeContentstring标签内容
shades[].shadeContentThirdViewstring第三人称内容
shades[].sourceTopicsarray来源主题
shades[].shadeNamePublicstring公开标签名称
shades[].shadeIconPublicstring公开图标 URL
shades[].confidenceLevelPublicstring公开置信度
shades[].shadeDescriptionPublicstring公开描述
shades[].shadeDescriptionThirdViewPublicstring公开第三人称描述
shades[].shadeContentPublicstring公开内容
shades[].shadeContentThirdViewPublicstring公开第三人称内容
shades[].sourceTopicsPublicarray公开来源主题
shades[].hasPublicContentboolean是否有公开内容

错误码

错误码说明
apikey.permission.denied缺少 userinfo 权限

搜索 Key Memory

按关键词搜索 Key Memory,支持分页。

GET /api/secondme/memory/key/search?keyword=&pageNo=1&pageSize=20

认证

需要 OAuth2 Token。

所需权限

memory.read

查询参数

参数类型必需说明
keywordstring搜索关键词
pageNointeger页码(默认: 1)
pageSizeinteger每页大小(默认: 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
  }
}
字段类型说明
listarrayKey Memory 列表
list[].idnumber记忆 ID
list[].factActorstring事实主体
list[].factObjectstring事实对象/分类
list[].factContentstring事实内容
list[].createTimenumber创建时间(毫秒时间戳)
list[].updateTimenumber更新时间(毫秒时间戳)
list[].visibilitynumber可见性
totalnumber总数

错误码

错误码说明
auth.token.invalidToken 无效或已过期