# 上传用户头像 API

上传用户头像,使用POST发起请求,请求地址为/api/v1/users/{id}/avatar

POST /api/v1/users/{id}/avatar HTTP/1.1

# 请求 URI

参数名 位置 类型 必填 说明
id path 整数 用户Id
apiKey query 字符串 API 密钥,请参考身份认证

# 返回

名称 类型 说明
200 OK User 用户
401 Unauthorized Error 认证错误
404 NotFound Error 资源不存在错误
400 BadRequest Error 参数错误

# 示例

# 请求示例

POST /api/v1/users/1008/avatar HTTP/1.1
Content-Type: multipart/form-data
X-SS-API-KEY: 7cd22002-27a7-4c5d-ba4d-a1c108a20eaf

# 返回示例

{
  "value": {
    "id": 1,
    "userName": "demo2",
    "password": "3CPlhZ8UAus=",
    "passwordFormat": "Encrypted",
    "passwordSalt": "VohMFwNz4s006ZytezfUxg==",
    "createDate": "2018-06-17 14:18:45",
    "lastResetPasswordDate": "2018-06-17 14:18:45",
    "lastActivityDate": "2018-06-17 14:18:45",
    "countOfLogin": 0,
    "countOfFailedLogin": 0,
    "countOfWriting": 0,
    "isChecked": true,
    "isLockedOut": false,
    "displayName": "演示",
    "email": "demo@sample.com",
    "mobile": "13888888888",
    "avatarUrl": "http://localhost/SiteFiles/UserFiles/demo/1717231727.png",
    "organization": "",
    "department": "",
    "position": "",
    "gender": "",
    "birthday": "",
    "education": "",
    "graduation": "",
    "address": "",
    "weiXin": "",
    "qq": "",
    "weiBo": "",
    "interests": "",
    "signature": ""
  }
}
上次更新: 2020-6-7 10:48:39