跳转到内容
开发者文档 / 资源接口

上传资源封面

上传或替换资源封面。调用者必须拥有该资源的编辑权限。

POST/api/resources/{resourceId}/head/upload

鉴权方式 请求头 Api-Key、Api-Secret

Content-Type multipart/form-data

参数

位置参数类型必填说明
pathresourceIdinteger是资源 ID
form-datafilefile是PNG、JPG/JPEG 或 GIF;最大 5 MB
bash
curl -X POST 'https://resource-api.xyeidc.com/api/resources/42/head/upload' \
  -H 'Api-Key: YOUR_API_KEY' \
  -H 'Api-Secret: YOUR_API_SECRET' \
  -F 'file=@./cover.jpg'

响应示例

json
{
  "code": 200,
  "msg": "Success!",
  "data": null
}

上传成功后重新获取资源详情,通过 headImgUuid 拼接 /client/members/pics/{headImgUuid}。新封面会替换旧文件。