添加用户自定义水印模板
POST
https://live.jdcloud-api.com/v1/watermarkCustoms:template
名称 | 类型 | 是否必需 | 默认值 | 描述 |
---|---|---|---|---|
position | Integer | False | 水印位置 - 取值范围:左上:1,右上:3, 左下:7,右下:9,默认:1 |
|
offsetUnit | String | False | 偏移量单位 - 取值: percent,pixel - percent:按百分比; pixel:像素 默认:pixel |
|
offsetX | Integer | True | x轴偏移量 - 取值范围 percent: (0,100] pixel: (0,1920] |
|
offsetY | Integer | True | y轴偏移量: - 取值范围 percent: (0,100] pixel: (0,1920] |
|
sizeUnit | String | False | 水印大小单位 - 取值: percent,pixel - percent:按百分比; pixel:像素 默认:pixel |
|
width | Integer | True | 水印宽度: - 取值范围 percent: (0,100] pixel: (0,1920] |
|
height | Integer | True | 水印高度: - 取值范围 percent: (0,100] pixel: (0,1920] |
|
template | String | True | 自定义水印模板名称 - 取值要求: 数字、大小写字母、短横线("-")、下划线("_"), 首尾不能有特殊字符("-"), 不超过50字符,utf-8格式 - 注意: 不能与已定义命名重复 |
|
uploadId | String | False | 创建上传任务时返回的uploadId参数,当通过接口上传水印图片时,uploadId必填 |
|
url | String | True | 水印地址 - 以 http:// 开头,可公开访问地址 |
名称 | 类型 | 描述 |
---|---|---|
requestId | String | requestId |
返回码 | 描述 |
---|---|
200 | OK |
400 | Invalid parameter |
401 | Authentication failed |
404 | Not found |
500 | Internal server error |
503 | Service unavailable |
POST
https://live.jdcloud-api.com/v1/watermarkCustoms:template
{ "height": 30, "offsetUnit": "pixel", "offsetX": 10, "offsetY": 20, "sizeUnit": "pixel", "template": "yourwatermark", "uploadId": "response uploadId from createImageUploadTask api", "url": "http://xxx.com/xxx.jpg", "width": 50 }
{ "requestId": "bgvmivir54gddpgi764se9f4kfr7ge41" }