同步生成图片-v1
POST
/v1/pics请求参数
Header 参数
Body 参数application/json
No schema defined
示例
{
"width": 640,
"height": 1050,
"backgroundColor": "#d75650",
"blocks": [
{
"x": 15,
"y": 268,
"width": 610,
"height": 770,
"backgroundColor": "#fff",
"borderColor": "#fff"
}
],
"texts": [
{
"x": 320,
"y": 185,
"text": "Davinci Li",
"font": "jiangxizhuokai",
"fontSize": 22,
"color": "#fff",
"width": 320,
"textAlign": "center",
"zIndex": 1
},
{
"x": 320,
"y": 220,
"text": "邀请你来参加抽奖",
"font": "jiangxizhuokai",
"fontSize": 22,
"color": "#fff",
"width": 320,
"textAlign": "center",
"zIndex": 1
},
{
"x": 30,
"y": 640,
"text": "奖品: 本田-CB650R 摩托车",
"font": "jiangxizhuokai",
"fontSize": 22,
"color": "#000",
"width": 580,
"textAlign": "left",
"zIndex": 1
},
{
"x": 30,
"y": 676,
"text": "01 月 31 日 18:00 自动开奖",
"font": "jiangxizhuokai",
"fontSize": 18,
"color": "#9a9a9a",
"width": 580,
"textAlign": "left",
"zIndex": 1
},
{
"x": 320,
"y": 960,
"text": "长按识别二维码,参与抽奖",
"font": "jiangxizhuokai",
"fontSize": 22,
"color": "#9a9a9a",
"width": 580,
"textAlign": "center",
"zIndex": 1
}
],
"lines": [
{
"startX": 30,
"startY": 720,
"endX": 610,
"endY": 720,
"width": 1,
"color": "#E1E1E1",
"zIndex": 1
}
],
"images": [
{
"x": 248,
"y": 25,
"width": 120,
"height": 120,
"url": "https://img-chengxiaoli-1253325493.cos.ap-beijing.myqcloud.com/bikers_327390-13.jpg",
"borderRadius": 60,
"zIndex": 1
},
{
"x": 108,
"y": 285,
"width": 400,
"height": 300,
"url": "https://img-chengxiaoli-1253325493.cos.ap-beijing.myqcloud.com/cb650R.jpeg",
"zIndex": 1
}
],
"qrcodes": [
{
"x": 208,
"y": 726,
"size": 200,
"content": "http://weixin.qq.com/r/yRzk-JbEbMsTrdKf90nb",
"foregroundColor": "#000",
"backgroundColor": "#fff",
"zIndex": 1
}
]
}
示例代码
返回响应
成功(200)
HTTP 状态码: 200
内容格式: JSONapplication/json
数据结构
code
integer
错误码
当错误码为 0 时,表示处理成功,其他值表示存在一定的问题
message
string
提示信息
用于解释错误原因
data
object
返回的数据
只在错误码为 0 时返回
url
string
生成的图片的访问链接
出于安全考虑,链接只有 5 分钟有效期
示例
成功示例
{
"code": 0,
"message": "ok",
"data": {
"url": "https://davinci.imgrender.cn/6e31cfcd683a36d0522a8cc34e244379.jpg?sign=xxx"
}
}
最后修改时间: 1 年前