最后更新于 2026.2.11

BaseUrl:https://v1.api.account.yuntower.com

1. 获取用户凭证

请求方法:POST

请求路径:/user/token/get

1.1. 请求体

参数 必须 类型 说明
appid string 应用ID
appsecret string 应用密钥
code string 临时访问代码
自授权成功起,有效期10分钟

1.2. 响应示例

{
    "code": 0,
    "msg": "success",
    "data": {
        "access_token": "atk_auth_fed3d0bc47f5xxx23a729b56557f274cafc5368618dc204f99",
        "access_token_expires_in": 43200,
        "access_token_expires_at": "2026-02-12 10:18:56",
        "refresh_token": "rtk_auth_c221636d2fe4e7xxxd65c766354a18f9fbbaee68",
        "refresh_token_expires_in": 2073600,
        "refresh_token_expires_at": "2026-03-07 22:18:56"
    }
}
参数 类型 说明
access_token string 用户访问凭证,有效期12小时
access_token_expires_in number access_token有效时间,单位秒
access_token_expires_at string access_token到期时间
refresh_token string 用户刷新凭证,用于刷新访问凭证,有效期24天(576小时)
refresh_token_expires_in number refresh_token有效时间,单位秒
refresh_token_expires_at string refresh_token到期时间

2. 获取用户信息

请求方法:POST

请求路径:/user/data

2.1. 请求体

参数 必须 类型 说明
appid string 应用唯一ID
appsecret string 应用密钥
access_token string 访问凭证

2.2. 响应示例

{
    "code": 0,
    "msg": "success",
    "data": {
        "profile": {
            "uid": "565170xxx98560",
            "username": "fish",
            "nickname": "fish",
            "avatar": "<http://account.yuntower.com//static/upload/avatar/331e5b3xxx22cc4b00.webp>"
        },
        "email": "[email protected]"
    }
}

2.3.1. profile

参数 类型 说明
uid number 用户唯一ID
username string 用户名(可变)
nickname string 昵称(可变)
avatar string 头像
city string 城市
intro string 简介

2.3.2. email