更新时间:2023-06-16 GMT+08:00
分享

获取图片列表

功能介绍

根据图片类型获取图片列表信息。

URI

GET https://{endpoint}/v1/{project_id}/digital-human/images?offset={offset}&limit={limit}&type={type}&resolution_type={resolution_type}

表1 路径参数

参数

是否必选

参数类型

描述

endpoint

String

终端节点,即调用API的请求地址。

不同服务不同区域的endpoint不同,您可以从终端节点中获取。

例如,CBS服务在“华北-北京四”区域的“endpoint”“cbs-ext.cn-north-4.myhuaweicloud.com”

project_id

String

项目ID,用于资源隔离。请参见获取项目ID

limit

Integer

设置每页有多少张图片。取值范围:大于等于1 。

默认值:10。

offset

Integer

跳过前多少张图片。取值范围:大于等于0 。

默认值:0。

resolution_type

Integer

横竖屏模式。

  • 0:横屏(默认)
  • 1:竖屏

type

Integer

图片类型。

  • 0:用户背景
  • 1:系统背景
  • 2:用户图标

默认值:0。

请求参数

响应参数

状态码: 200

表2 响应Body参数

参数

参数类型

描述

quota

Integer

配额。

total

Integer

总数。

offset

Integer

偏移。

count

Integer

返回数量。

images

Array of Image objects

图片列表。

表3 Image

参数

参数类型

描述

create_time

String

创建时间。

update_time

String

更新时间。

id

String

图片ID。

image_frame

ImageFrame object

图片框架。

image_url

String

图片的obs路径。

name

String

图片名称。

resolution_type

Integer

横竖屏模式。

  • 0:横版
  • 1:竖版

type

Integer

图片类型。

  • 0:用户背景
  • 1:系统背景
  • 2:用户图标
表4 ImageFrame

参数

参数类型

描述

create_time

String

创建时间。

update_time

String

更新时间。

frame_resolution_type

Integer

框的长宽比。

  • 0: 16/9
  • 1: 4/3
  • 2: 3/4

id

String

框架ID。可以通过获取图片列表获取。

image_frame_position

LeftRightPosition object

框的默认地址。

image_position

LeftRightPosition object

插图的默认地址。

resolution_type

Integer

横竖屏模式。

  • 0:横版
  • 1:竖版

url

String

框的存储地址。

表5 LeftRightPosition

参数

参数类型

描述

left

Position object

框在左边的坐标。

right

Position object

框在右边的坐标。

表6 Position

参数

参数类型

描述

x

Integer

像素坐标x。

y

Integer

像素坐标x。

状态码: 400

表7 响应Body参数

参数

参数类型

描述

error_code

String

错误码 CBS.XXXX

error_msg

String

错误详情

状态码: 500

表8 响应Body参数

参数

参数类型

描述

error_code

String

错误码 CBS.XXXX

error_msg

String

错误详情

请求示例

获取5张系统背景图片列表信息

GET https://{endpoint}/v1/{project_id}/digital-human/images?type=1&limit=5

响应示例

状态码: 200

OK

{
  "quota" : 100,
  "total" : 9,
  "offset" : 0,
  "count" : 5,
  "images" : [ {
    "id" : "94e06659-75f6-461a-abb5-be83bc95a58a",
    "type" : 1,
    "name" : "纯白",
    "create_time" : "2022-01-10T12:04:38Z",
    "update_time" : "2022-01-10T12:04:38Z",
    "image_url" : "https://cbs-digital-human-cn-north-4.obs.cn-north-4.myhuaweicloud.com:443/background/white.jpg?AccessKeyId=EHAEEDH1I4LVACFHO5IB&Expires=1668843300&Signature=whoXDnV30FmB2rJIZhOL2RMgysA%3D",
    "image_frame" : {
      "id" : "white",
      "url" : "https://cbs-digital-human-cn-north-4.obs.cn-north-4.myhuaweicloud.com:443/image_frame/white.png?AccessKeyId=EHAEEDH1I4LVACFHO5IB&Expires=1668843300&Signature=JyJoYuGZk0P91ypvgBVrPCs8PVY%3D",
      "image_frame_position" : {
        "left" : {
          "x" : 200,
          "y" : 200
        },
        "right" : {
          "x" : 808,
          "y" : 200
        }
      },
      "image_position" : {
        "left" : {
          "x" : 282,
          "y" : 278
        },
        "right" : {
          "x" : 890,
          "y" : 278
        }
      },
      "resolution_type" : 0
    },
    "resolution_type" : 0
  }, {
    "id" : "14e04559-75f6-365a-eru5-553frg334443",
    "type" : 1,
    "name" : "新闻",
    "create_time" : "2022-06-21T12:04:38Z",
    "update_time" : "2022-06-21T12:04:38Z",
    "image_url" : "https://cbs-digital-human-cn-north-4.obs.cn-north-4.myhuaweicloud.com:443/background/%E6%96%B0%E9%97%BB%E8%83%8C%E6%99%AF.png?AccessKeyId=EHAEEDH1I4LVACFHO5IB&Expires=1668843300&Signature=HXZNFmIsG4mwM5u7Wrf%2FK7LsBfQ%3D",
    "image_frame" : {
      "id" : "broadcast",
      "url" : "https://cbs-digital-human-cn-north-4.obs.cn-north-4.myhuaweicloud.com:443/image_frame/broadcast.png?AccessKeyId=EHAEEDH1I4LVACFHO5IB&Expires=1668823706&Signature=mrhFJkHtd0hpzgaq7H9tFXx%2B7LQ%3D",
      "image_frame_position" : {
        "left" : {
          "x" : 200,
          "y" : 290
        },
        "right" : {
          "x" : 882,
          "y" : 290
        }
      },
      "image_position" : {
        "left" : {
          "x" : 244,
          "y" : 327
        },
        "right" : {
          "x" : 926,
          "y" : 327
        }
      },
      "frame_resolution_type" : 0,
      "resolution_type" : 0
    },
    "resolution_type" : 0
  }, {
    "id" : "14e04559-75f6-461a-abb5-b23frg95a583",
    "type" : 1,
    "name" : "教育",
    "create_time" : "2022-06-21T12:04:38Z",
    "update_time" : "2022-06-21T12:04:38Z",
    "image_url" : "https://cbs-digital-human-cn-north-4.obs.cn-north-4.myhuaweicloud.com:443/background/%E6%95%99%E8%82%B2%E8%83%8C%E6%99%AF.jpg?AccessKeyId=EHAEEDH1I4LVACFHO5IB&Expires=1668843300&Signature=o2SxR%2F7dZtLVLEaeLde08W8NNK0%3D",
    "image_frame" : {
      "id" : "broadcast",
      "url" : "https://cbs-digital-human-cn-north-4.obs.cn-north-4.myhuaweicloud.com:443/image_frame/broadcast.png?AccessKeyId=EHAEEDH1I4LVACFHO5IB&Expires=1668823706&Signature=mrhFJkHtd0hpzgaq7H9tFXx%2B7LQ%3D",
      "image_frame_position" : {
        "left" : {
          "x" : 200,
          "y" : 290
        },
        "right" : {
          "x" : 882,
          "y" : 290
        }
      },
      "image_position" : {
        "left" : {
          "x" : 244,
          "y" : 327
        },
        "right" : {
          "x" : 926,
          "y" : 327
        }
      },
      "frame_resolution_type" : 0,
      "resolution_type" : 0
    },
    "resolution_type" : 0
  }, {
    "id" : "14e04559-75f6-461a-abb5-be83bc95a583",
    "type" : 1,
    "name" : "金融",
    "create_time" : "2022-06-21T12:04:38Z",
    "update_time" : "2022-06-21T12:04:38Z",
    "image_url" : "https://cbs-digital-human-cn-north-4.obs.cn-north-4.myhuaweicloud.com:443/background/%E9%87%91%E8%9E%8D.png?AccessKeyId=EHAEEDH1I4LVACFHO5IB&Expires=1668843300&Signature=7EqMUbLjTRye8DQUCsvfGo%2F1HIA%3D",
    "image_frame" : {
      "id" : "broadcast",
      "url" : "https://cbs-digital-human-cn-north-4.obs.cn-north-4.myhuaweicloud.com:443/image_frame/broadcast.png?AccessKeyId=EHAEEDH1I4LVACFHO5IB&Expires=1668823706&Signature=mrhFJkHtd0hpzgaq7H9tFXx%2B7LQ%3D",
      "image_frame_position" : {
        "left" : {
          "x" : 200,
          "y" : 290
        },
        "right" : {
          "x" : 882,
          "y" : 290
        }
      },
      "image_position" : {
        "left" : {
          "x" : 244,
          "y" : 327
        },
        "right" : {
          "x" : 926,
          "y" : 327
        }
      },
      "frame_resolution_type" : 0,
      "resolution_type" : 0
    },
    "resolution_type" : 0
  }, {
    "id" : "14e04559-75f6-461a-abc5-b23frg95a583",
    "type" : 1,
    "name" : "党政",
    "create_time" : "2022-06-21T12:04:38Z",
    "update_time" : "2022-06-21T12:04:38Z",
    "image_url" : "https://cbs-digital-human-cn-north-4.obs.cn-north-4.myhuaweicloud.com:443/background/%E5%85%9A%E6%94%BF%E8%83%8C%E6%99%AF.jpg?AccessKeyId=EHAEEDH1I4LVACFHO5IB&Expires=1668843300&Signature=82YTgaPnehyH40f%2FC8pSaj4JZQk%3D",
    "image_frame" : {
      "id" : "broadcast",
      "url" : "https://cbs-digital-human-cn-north-4.obs.cn-north-4.myhuaweicloud.com:443/image_frame/broadcast.png?AccessKeyId=EHAEEDH1I4LVACFHO5IB&Expires=1668823706&Signature=mrhFJkHtd0hpzgaq7H9tFXx%2B7LQ%3D",
      "image_frame_position" : {
        "left" : {
          "x" : 200,
          "y" : 290
        },
        "right" : {
          "x" : 882,
          "y" : 290
        }
      },
      "image_position" : {
        "left" : {
          "x" : 244,
          "y" : 327
        },
        "right" : {
          "x" : 926,
          "y" : 327
        }
      },
      "frame_resolution_type" : 0,
      "resolution_type" : 0
    }
  
  } ]
}

状态码: 400

Bad Request

{
  "error_code" : "CBS.0003",
  "error_msg" : "This resource Id:[33dbe0e2-bb9b-4efc-a420-34acd78a5bb6] does not exist."
}

状态码: 500

Internal Server Error

{
  "error_code" : "CBS.0004",
  "error_msg" : "Internal Server Error"
}

状态码

状态码

描述

200

OK

400

Bad Request

500

Internal Server Error

错误码

请参见错误码

分享:

    相关文档

    相关产品