GET_IMAGE_ANIMATIONS API 接口文档

接口信息

功能描述

获取图片出入场动画列表,返回所有支持的且满足条件的图片出入场动画。支持根据动画类型(入场、出场、循环)和会员模式(所有、VIP、免费)进行筛选。

更多文档: 📖 速创 AIGC-工具平台官方文档

请求参数

{
  "mode": 0,
  "type": "in"
}

参数说明

参数名 类型 必填 默认值 说明
mode integer 0 动画模式:0=所有,1=VIP,2=免费
type string - 动画类型:in=入场,out=出场,loop=循环

参数详解

动画模式参数

动画类型参数

动画模式说明

模式值 模式名称 描述
0 所有 返回所有动画(包括 VIP 和免费)
1 VIP 仅返回 VIP 动画
2 免费 仅返回免费动画

动画类型说明

类型值 类型名称 描述
in 入场动画 图片出现时的动画效果
out 出场动画 图片消失时的动画效果
loop 循环动画 图片持续播放的循环动画效果

响应格式

成功响应 (200)

{
  "effects": [
    {
      "resource_id": "7314291622525538844",
      "type": "in",
      "category_id": "pic_ruchang",
      "category_name": "图片入场",
      "duration": 600000,
      "id": "35395179",
      "name": "渐显出现",
      "request_id": "",
      "start": 0,
      "icon_url": "https://lf5-hl-hw-effectcdn-tos.byteeffecttos.com/obj/ies.fe.effect/fade_in_pic_icon",
      "material_type": "sticker",
      "panel": "",
      "path": "",
      "platform": "all"
    }
  ]
}

响应字段说明

字段名 类型 说明
effects array 图片动画对象数组

单个动画对象字段说明

字段名 类型 说明
resource_id string 动画资源 ID
type string 动画类型(in/out/loop)
category_id string 动画分类 ID
category_name string 动画分类名称
duration integer 动画时长(微秒)
id string 动画唯一标识 ID
name string 动画名称
request_id string 请求 ID(通常为空)
start integer 动画开始时间
icon_url string 动画图标 URL
material_type string 素材类型(通常为"sticker")
panel string 面板信息
path string 路径信息
platform string 支持平台(通常为"all")

错误响应 (4xx/5xx)

{
  "detail": "错误信息描述"
}

使用示例

cURL 示例

1. 获取所有入场动画

curl -X POST https://agent.aigc-ai.com/openapi/capcut-tools/v1/get_image_animations \
  -H "Content-Type: application/json" \
  -d '{
    "mode": 0,
    "type": "in"
  }'

2. 获取 VIP 出场动画

curl -X POST https://agent.aigc-ai.com/openapi/capcut-tools/v1/get_image_animations \
  -H "Content-Type: application/json" \
  -d '{
    "mode": 1,
    "type": "out"
  }'

3. 获取免费循环动画

curl -X POST https://agent.aigc-ai.com/openapi/capcut-tools/v1/get_image_animations \
  -H "Content-Type: application/json" \
  -d '{
    "mode": 2,
    "type": "loop"
  }'

错误码说明

错误码 错误信息 说明 解决方案
400 type 参数必须为 in、out 或 loop 动画类型参数无效 使用正确的 type 值:"in"、"out"或"loop"
400 mode 参数必须为 0、1 或 2 动画模式参数无效 使用正确的 mode 值:0、1 或 2
500 获取图片动画失败 内部处理错误 联系技术支持

注意事项

工作流程

  1. 验证必填参数(type)
  2. 验证可选参数(mode)的有效性
  3. 根据 type 和 mode 筛选图片动画数据
  4. 返回符合条件的动画对象数组
  5. 服务端自动处理数据格式化

相关接口