编辑素材

最后更新:2024/08/02

企业可通过此接口编辑素材。 接口参数包含固定参数与素材属性参数。每一种素材上传的公共参数不变,素材属性参数跟素材类型进行对应。

请求方式: POST(HTTPS)

请求地址: https://open.wshoto.com/openapi/media/edit?access_token=x

Query参数:

参数 类型 必填 说明
access_token string 调用接口凭证

Body参数(公用):

所有素材类型都需要使用到公用参数,根据素材类型不同在传素材类型特有参数。

参数 类型 必填 说明
category_id long 分类id
type int 类型 1:海报,2:文本,3:图片,4:文章,6:视频,7:文件,8:小程序,9:网页
private_flag bool 是否是我的素材
user_id string 创建人id
id long 素材id
publish_status int 0:长期有效 2:自定义有效时间 3:停用(默认长期有效)
start_time long 有效开始时间,时间戳,格式:秒
end_time long 有效结束时间,时间戳,格式:秒

海报:

{
  "id": 123,
  "category_id": 741,
  "type": 1,
  "private_flag": false,
  "user_id": "Wang",
  "publish_status": 2,
  "start_time": 1688203011,
  "end_time": 1701422211,
  "title": "标题",
  "snapshot_url": "fake_data",
  "thumbnail_url": "fake_data"
}
参数 类型 必填 说明
title string 标题
snapshot_url string 海报快照url
thumbnail_url string 海报缩略图url

文本素材:

{
  "id": 123,
  "category_id": 741,
  "type": 2,
  "private_flag": true,
  "user_id": "Wang",
  "publish_status": 2,
  "start_time": 1688203011,
  "end_time": 1701422211,
  "plain_text": "文本内容",
  "title": "标题"
}
参数 类型 必填 说明
plain_text string 文本内容
title string 标题

图片素材:

{
  "id": 123,
  "category_id": 741,
  "type": 3,
  "private_flag": true,
  "user_id": "Wang",
  "publish_status": 2,
  "start_time": 1688203011,
  "end_time": 1701422211,
  "file_id": 123,
  "title": "这是一个文件标题"
}
参数 类型 必填 说明
file_id long 文件id
title string 图片标题

文章素材:

{
  "id": 123,
  "category_id": 0,
  "type": 4,
  "private_flag": true,
  "user_id": "Wang",
  "publish_status": 2,
  "start_time": 1688203011,
  "end_time": 1701422211,
  "web_type": 1,
  "title": "标题",
  "abstract_info": "摘要",
  "web_content": "<p>正文<p>",
  "image_base": 0
}
参数 类型 必填 说明
web_type int 文章类型 1:自定义文章
title string 标题
abstract_info string 摘要
web_content string 正文(格式为html)
image_base string 封面图文件id

网页素材:

{
  "id": 123,
  "category_id": 741,
  "type": 9,
  "private_flag": true,
  "user_id": "Wang",
  "publish_status": 2,
  "start_time": 1688203011,
  "end_time": 1701422211,
  "title": "新建网页",
  "abstract_info": "",
  "origin_link": "http://123.com",
  "image_base": "23676"
}
参数 类型 必填 说明
title string 标题
abstract_info string 摘要
origin_link string 原始链接
image_base string 封面图文件id

视频素材:

{
  "id": 123,
  "category_id": 741,
  "type": 6,
  "private_flag": true,
  "user_id": "Wang",
  "publish_status": 2,
  "start_time": 1688203011,
  "end_time": 1701422211,
  "image_base": "123",
  "file_id": 123,
  "title": "这是视频标题",
  "abstract_info": "这是摘要"
}
参数 类型 必填 说明
image_base string 封面图文件id
file_id string 视频文件id
title string 视频标题
abstract_info string 视频摘要

文件素材:

{
  "id": 123,
  "category_id": 741,
  "type": 7,
  "private_flag": true,
  "user_id": "Wang",
  "publish_status": 2,
  "start_time": 1688203011,
  "end_time": 1701422211,
  "file_id": 123,
  "title": "这是一个文件标题"
}
参数 类型 必填 说明
file_id long 文件内容
title string 文件标题

小程序素材:

{
  "id": 123,
  "category_id": 741,
  "type": 8,
  "private_flag": true,
  "user_id": "Wang",
  "publish_status": 2,
  "start_time": 1688203011,
  "end_time": 1701422211,
  "title": "测试新建",
  "image_base": "23675",
  "app_id": "wx81190b2c32e2c2d3",
  "app_path": "page/s"
}
参数 类型 必填 说明
title string 标题
image_base string 封面图文件id
app_id string 小程序id
app_path string 小程序路径

返回值:

{
  "code": 0,
  "msg": "请求成功",
  "data": true
}

返回说明:

参数 类型 说明
code int 出错返回码,为0表示成功,非0表示调用失败
msg string 返回码描述
data bool 是否编辑成功

results matching ""

    No results matching ""