上传用户头像API

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

  1. 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 参数错误

示例

请求示例

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

返回示例

  1. {
  2. "value": {
  3. "id": 1,
  4. "userName": "demo2",
  5. "password": "3CPlhZ8UAus=",
  6. "passwordFormat": "Encrypted",
  7. "passwordSalt": "VohMFwNz4s006ZytezfUxg==",
  8. "createDate": "2018-06-17 14:18:45",
  9. "lastResetPasswordDate": "2018-06-17 14:18:45",
  10. "lastActivityDate": "2018-06-17 14:18:45",
  11. "countOfLogin": 0,
  12. "countOfFailedLogin": 0,
  13. "countOfWriting": 0,
  14. "isChecked": true,
  15. "isLockedOut": false,
  16. "displayName": "演示",
  17. "email": "demo@sample.com",
  18. "mobile": "13888888888",
  19. "avatarUrl": "http://localhost/SiteFiles/UserFiles/demo/1717231727.png",
  20. "organization": "",
  21. "department": "",
  22. "position": "",
  23. "gender": "",
  24. "birthday": "",
  25. "education": "",
  26. "graduation": "",
  27. "address": "",
  28. "weiXin": "",
  29. "qq": "",
  30. "weiBo": "",
  31. "interests": "",
  32. "signature": ""
  33. }
  34. }