跳转至

上传素材

通过该接口可以进行素材的上传

请求地址

https://openapi.aiclk.com/openapi/v1/material/upload

所属权限

ads_write

请求方式

POST

Header : content-type: multipart/form-data

请求参数

Url中添加如下参数:

字段名 类型 是否必须 描述
account_id int 广告主ID(广告投放平台的userID)

Post-Form添加参数:

字段名 类型 是否必须 描述
file 文件 上传的文件
material_type string 文件类型。枚举值。不填则系统会根据文件格式+宽高大小比例进行自动匹配,请严格按照枚举值中的宽高进行上传
pid string 渠道包ID。APP渠道名称,素材类型为APP可传值,必填

请求示例

curl -X POST \
  'https://openapi.aiclk.com/openapi/v1/material/upload?account_id=1000001' \
  -H 'OGW_ACCESS_TOKEN: your_access_token' \
  -H 'content-type: multipart/form-data' \
  -F file=@/tmp/27sdf723hsf235.png \
  -F type=IMAGE \
  -F pid=18372

返回字段释义

字段名 类型 描述
code int 返回码
message string 返回信息
data object 处理结果
- id string 素材ID
- name string 文件名
- remote_url string 文件访问地址
- post_url string 视频封面URL
- app_logo_url string apk icon 访问url,当文件为APP时,返回值不为空
- pid string 渠道包ID,当文件为APP时,返回值不为空
- cover object 仅在文件类型为视频时返回,自动上传视频第一帧为封面素材,返回值等同于调用此接口

返回示例

{
  "code": 200,
  "data": {
    "app_logo_url": "",
    "id": 24198456,
    "name": "8e9d31caced1c90be49ee170424e4550",
    "pid": 0,
    "post_url": "http://oss.material.aiclk.com/live/cover/1000002/e467056d011856d948c81c6860e3c3f5.jpg",
    "remote_url": "http://v2.aiclk.com/horizontal/1000002/live/e467056d011856d948c81c6860e3c3f5.mp4",
    "cover": {
      "app_logo_url": "",
      "id": 24198455,
      "name": "8e9d31caced1c90be49ee170424e4550",
      "pid": 0,
      "post_url": "",
      "remote_url": "http://oss.material.aiclk.com/live/cover/1000002/e467056d011856d948c81c6860e3c3f5.jpg"
    }
  },
  "message": "success",
  "trace_id": "7e2e41bfeefa2a9a"
}