Skip to content

POST /api/v1/albums/{id}/assets

POST/api/v1/albums/{id}/assets

相册资产管理(add/remove)

useroperationId: albumManageAssets

请求参数

名称类型位置必填说明
idstringpath是—

请求体

请求数据

Content-Type · application/json

{
  "type": "object",
  "required": [
    "asset_ids",
    "action"
  ],
  "properties": {
    "asset_ids": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      }
    },
    "action": {
      "type": "string",
      "enum": [
        "add",
        "remove"
      ]
    }
  }
}

请求示例

cURL
curl -X POST 'http://localhost:8080/api/v1/albums/{id}/assets' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <JWT>'
JavaScript
const res = await fetch('http://localhost:8080/api/v1/albums/{id}/assets', {
  method: 'POST',
  headers: {
    'Accept': 'application/json',
    'Authorization': 'Bearer <JWT>'
  },
});
const data = await res.json();
Python
import requests

res = requests.post(
    'http://localhost:8080/api/v1/albums/{id}/assets',
    headers={'Accept': 'application/json', 'Authorization': 'Bearer <JWT>'}
)
print(res.json())

响应

200成功

application/json

{
  "type": "object",
  "description": "通用响应包装",
  "properties": {
    "code": {
      "type": "string",
      "example": "ok"
    },
    "message": {
      "type": "string",
      "example": "ok"
    },
    "data": {}
  }
}
400请求参数错误

application/json

{
  "type": "object",
  "properties": {
    "code": {
      "type": "string",
      "example": "not_found"
    },
    "message": {
      "type": "string",
      "example": "资源不存在"
    }
  }
}

在线调试

在线调试
凭证仅保存在当前页面内存中
自定义请求 Header