提交模板接口

接口说明

  • 请求地址: https://api.aiofish.com/rest/vsms/v1/tpl
  • 请求方式: POST
  • Content-Type: multipart/form-data
  • 以http表单形式单次上传多个附件,key为表单的“file“字段。除了文件数据外的请求参数转换为Json字符串,key为表单的“data“字段

字段说明

参数名必填参数类型说明
appKeyString系统分配
tsString时间戳
titleString模板标题
contentArray[ContentList>模板内容。内容按照帧的形式展示,每一帧包含文字或其他资源

数据模型

ContentList

参数名必填参数类型说明
orderByInt代表该内容在本帧内的顺序
frameIndexInt代表帧所在的位置
extTypeInt内容类型。1:文字内容,2:文件资源
textString当类型为2时填写文件名。当类型为1时该字段为文字内容,当内容中含有可变参数时,则用#p_1#,#p_2#..#p_5# 占位,变量非必须使用,最多使用5个变量,每个变量值的长度最多不超过15位

Curl样例

 curl  --request POST 'https://api.aiofish.com/rest/vsms/v1/tpl' 
 --header 'x-sign: 39dd91319d32b36def6272e1b9' 
 --form 'data="{\"appKey\":\"xxxxx\",\"ts\":\"1638805414651\",\"title\":\"测试\",\"content\":[{\"orderBy\":1,\"frameIndex\":1,\"extType\":2,\"text\":\"aaa.jpg\"},{\"orderBy\":2,\"frameIndex\":1,\"extType\":1,\"text\":\"【测试】内容测试\"}]}"' 
 --form 'file=@"aaa.jpg"'

响应字段

字段名字段类型说明
codeString错误码。‘success’:成功,其他失败
tplIdString模板ID。当code为‘success’请求成功时生成