API DocsAPI Docs
post/api/group/{groupId}/images
post/api/group/{groupId}/images
上传图片到小组
Basic Information
Request Method:
post
Request URL:
https://www.lycoo.com/api/group/{groupId}/images
Tags:
小组图片管理
Description
将图片上传到指定的小组。用户需要是小组成员才能上传图片。
支持JPEG、PNG、GIF、WEBP、BMP和SVG格式的图片,最大文件大小为30MB。
上传后的图片将存储在 groupImages/<groupId>/<imageId>.<ext>
路径。
用途:
- 上传图片到小组供文章使用
- 构建小组的图片库
Path Parameters
Path Parameters Explanation
Path parameters are variables in the URL path, for example:
https://www.lycoo.com/api/group/:groupId/images
Parameter Name | Type | Required | Example Value | Description |
---|---|---|---|---|
groupId | string | Required | example | 小组ID |
Header Parameters
Header Parameters Explanation
Header parameters are used to pass additional information, such as authentication credentials, content type, etc.
Parameter Name | Type | Required | Example Value | Description |
---|---|---|---|---|
Authorization | string | Required | Bearer sha_1234567890abcdef... | The authentication header is used to verify the identity of API requests, containing an access token Format: Bearer {token} |
Request Body Parameters
Request Body Parameters Explanation
Request body parameters are used to pass complex structured data, typically using the following format: application/json
Parameter Details
Parameter Name | Type | Required | Example Value | Description |
---|---|---|---|---|
image | string | Required | 25 | 要上传的图片文件 格式: binary |
JSON Example
{
"image": "string"
}
Response Example
200图片上传成功
{
"success": true,
"message": "图片上传成功"
}
400文件格式不支持或超过大小限制
{
"success": false,
"message": "无效的文件类型。只允许JPEG、PNG、GIF、WEBP、BMP和SVG格式的图片。"
}
401
403用户不是小组成员,无权上传图片
{
"success": false,
"message": "您不是该小组成员,无权上传图片"
}
404小组不存在
{
"success": false,
"message": "小组不存在或已被删除"
}
500