You need to enable JavaScript to run this app.
导航
获取样式详情
最近更新时间:2024.09.03 16:47:46首次发布时间:2022.07.20 10:02:25

本接口支持通过输入样式 ID,获取该样式各要素(图片、文字、二维码、背景等)的配置项详情。

使用限制

  • 请求频率限制:5 次/秒
  • 超时时间:10 秒
  • 服务地址:仅支持使用国内对应的 OpenAPI 域名,具体请见请求地址

请求说明

  • 接口名称:GetImageStyleDetail
  • 请求方式:GET
  • 请求地址:https://imagex.volcengineapi.com/?Action=GetImageStyleDetail&Version=2018-08-01

请求参数

以下请求参数列表仅列出了该接口的部分公共参数,完整公共参数列表见公共参数

参数类型是否必选描述
ActionString接口名称。
VersionString接口版本。veImageX 当前 API 的版本为 2018-08-01
StyleIdString样式 ID。

返回参数

参数类型描述
StyleJSON Object样式结构,即样式的图片、文字、背景等要素的参数配置项,具体请参考样式结构

示例

请求示例

GET https://imagex.volcengineapi.com/?imagex-lang=zh&Action=GetImageStyleDetail&Version=2018-08-01&StyleId=62ce6581a1520596600b786*

正常返回示例

{
   "ResponseMetadata":
   {
      "RequestId":"2022071517562001021219713105A6AE83",
      "Action":"GetImageStyleDetail",
      "Version":"2018-08-01",
      "Service":"imagex",
      "Region":"cn-north-1"
   },
   "Result":{
      "Style":{
         "id":"62ce6581a1520596600b786*",
         "name":"猫",
         "width":1080,
         "height":1920,
         "unit":"px",
         "service":"nnsl1jf0m*",
         "background":{
            "fill":"#FFFFFF",
            "fillSrc":"tos-cn-i-nnsl1jf0mq/mofang/a566342de9c0*.jpg",
            "viewpoint":{
               "x":0.341796875,
               "y":0,
               "width":0.31640625,
               "height":1
            }
         },
         "elements":[
            {
               "id":"el181f63c9494*",
               "name":"图片1",
               "type":"image",
               "left":372,
               "top":587,
               "width":320,
               "height":560,
               "content":"tos-cn-i-ldojp2yol9/mofang/779a640e6f743ecc*.jpeg",
               "opacity":100,
               "angle":0,
               "flipX":false,
               "flipY":false,
               "attr":{
                  "viewpoint":{
                     "x":0,
                     "y":0,
                     "width":1,
                     "height":1
                  },
                  "fillptn":{
                     "ptn":1,
                     "viewpoint":{
                        "x":0,
                        "y":0,
                        "width":1,
                        "height":1
                     },
                     "viewLoc":5,
                     "bgColor":""
                  },
                  "filter":[
                     
                  ]
               }
            },
            {
               "id":"el181f63cb387*",
               "name":"文本1",
               "type":"text",
               "left":441,
               "top":944,
               "width":198,
               "height":32,
               "content":"猫咪",
               "opacity":100,
               "angle":0,
               "flipX":false,
               "flipY":false,
               "attr":{
                  "font":"SourceHanSans-Regular.ttf",
                  "fontSize":32,
                  "fontAdapt":false,
                  "fillptn":{
                     "name":"color",
                     "param":{
                        "color":"#000000"
                     }
                  },
                  "textAlign":1,
                  "textAlignH":0,
                  "lineSpace":1.3,
                  "wordSpace":0,
                  "writingMode":0,
                  "bold":false,
                  "oblique":false,
                  "linethrough":false,
                  "underline":false,
                  "adapt":false,
                  "border":{
                     "weight":0,
                     "dash":0,
                     "radius":0,
                     "color":"#000000",
                     "paddingTop":0,
                     "paddingBottom":0,
                     "paddingLeft":0,
                     "paddingRight":0
                  }
               }
            },
            {
               "id":"el181f63d7c89*",
               "name":"二维码1",
               "type":"qrcode",
               "left":591,
               "top":1047,
               "width":100,
               "height":100,
               "content":"https://console.volcengine.com/imagex/add_ons/",
               "opacity":100,
               "angle":0,
               "flipX":false,
               "flipY":false,
               "attr":{
                  "type":0
               }
            }
         ],
         "output":{
            "format":"WEBP",
            "quality":0
         }
      }
   }
}

异常返回示例

{
    "ResponseMetadata": {
        "RequestId": "2022071517562001021219713105A6AE83",
        "Action": "GetImageStyleDetail",
        "Version": "2018-08-01",
        "Service": "imagex",
        "Region": "cn-north-1",
        "Error": {
             "Code": "xx",
            "Message": "xx"
        }
    }
}

错误码

访问公共错误码创意魔方错误码获取详细信息。