Queries watermark templates.

Usage notes

You can call this operation to query up to 10 watermark templates at a time.

QPS limit

You can call this API operation up to 100 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. For more information, see QPS limit.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes QueryWaterMarkTemplateList

The operation that you want to perform. Set the value to QueryWaterMarkTemplateList.

WaterMarkTemplateIds String Yes 3780bd69b2b74540bc7b1096f564****

The IDs of the watermark templates that you want to query. To obtain the IDs of the watermark templates, you can log on to the ApsaraVideo Media Processing (MPS) console and choose Global Settings > Watermark Templates in the left-side navigation pane. You can query up to 10 watermark templates at a time. Separate multiple IDs of watermark templates with commas (,).

Response parameters

Parameter Type Example Description
RequestId String 17079AF5-6276-51A9-B755-D26594C93F3C

The ID of the request.

NonExistWids Array of String 72dfa5e679ab4be9a3ed9974c736****

The watermark template IDs that do not exist. This parameter is not returned if all specified watermark templates are found.

WaterMarkTemplateList Array of WaterMarkTemplate

The details of the watermark templates.

WaterMarkTemplate
Type String Image

The type of the watermark. Valid values:

  • Image, and
  • Text.
Note Only watermarks of the Image type are supported.
RatioRefer Object

The values of the Height, Width, Dx, and Dy parameters relative to the reference edges. If the values of the Height, Width, Dx, and Dy parameters are decimals between 0 and 1, the values are calculated by referring to the following edges in sequence:

  • Width: the width edge.
  • Height: the height edge.
  • Long: the long edge.
  • Short: the short edge.
Dx String 0.51

The horizontal offset of the watermark relative to the output video image. Default value: 0. The default value indicates no offset. The value can be an integer or a decimal.

  • Integer: the vertical offset. This indicates the absolute position. Unit: pixel.
  • Decimal: the ratio of the horizontal offset to the width of the output video. The ratio varies based on the size of the video. Four decimal places are supported, such as 0.9999. More decimal places are discarded.
Width String 0.36

The width of the watermark image in the output video. The value can be an integer or a decimal.

  • Integer: the width of the watermark image. This indicates the absolute position. Unit: pixel.
  • Decimal: the ratio of the width of the watermark image to the width of the output video. The ratio varies based on the size of the video. Four decimal places are supported, such as 0.9999. More decimal places are discarded.
Height String 0.33

The height of the watermark image in the output video. The value can be an integer or a decimal.

  • Integer: the height of the watermark image. This indicates the absolute position. Unit: pixel.
  • Decimal: the ratio of the height of the watermark image to the height of the output video. The ratio varies based on the size of the video. Four decimal places are supported, such as 0.9999. More decimal places are discarded.
Dy String 0.4

The vertical offset of the watermark relative to the output video image. Default value: 0. The default value indicates no offset. The value can be an integer or a decimal.

  • Integer: the vertical offset. This indicates the absolute position. Unit: pixel.
  • Decimal: the ratio of the vertical offset to the height of the output video. The ratio varies based on the size of the video. Four decimal places are supported, such as 0.9999. More decimal places are discarded.
ReferPos String TopRight

The position of the watermark. Valid values:

  • TopRight: the upper-right corner.
  • TopLeft: the upper-left corner.
  • BottomRight: the lower-right corner.
  • BottomLeft: the lower-left corner.
State String Normal

The status of the watermark template. Valid values: Valid values:

  • Normal: The watermark template is normal.
  • Deleted: The watermark template is deleted.
Dx String 100

The horizontal offset. Unit: pixel.

Width String 8

The width of the watermark image. Unit: pixel.

Height String 8

The height of the watermark image. Unit: pixel.

Timeline Object

The timeline of the watermark.

Start String 0

The beginning of the time range during which the watermark is displayed.

  • Unit: seconds.
  • Default value: 0.
Duration String 10

The display duration of the watermark. Default value: ToEND. The default value indicates that the watermark is displayed until the video ends.

Name String example-watermark

The name of the watermark template.

Dy String 100

The vertical offset. Unit: pixel.

Id String 3780bd69b2b74540bc7b1096f564****

The ID of the watermark template.

Examples

Sample requests

http(s)://mts.cn-shanghai.aliyuncs.com/?Action=QueryWaterMarkTemplateList
&WaterMarkTemplateIds=3780bd69b2b74540bc7b1096f564****
&<Common request parameters>

Sample success response

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<QueryWaterMarkTemplateListResponse>
    <RequestId>17079AF5-6276-51A9-B755-D26594C93F3C</RequestId>
    <NonExistWids>72dfa5e679ab4be9a3ed9974c736****</NonExistWids>
    <WaterMarkTemplateList>
        <Type>Image</Type>
        <RatioRefer>
            <Dx>0.51</Dx>
            <Width>0.36</Width>
            <Height>0.33</Height>
            <Dy>0.4</Dy>
        </RatioRefer>
        <ReferPos>TopRight</ReferPos>
        <State>Normal</State>
        <Dx>100</Dx>
        <Width>8</Width>
        <Height>8</Height>
        <Timeline>
            <Start>0</Start>
            <Duration>10</Duration>
        </Timeline>
        <Name>example-watermark</Name>
        <Dy>100</Dy>
        <Id>3780bd69b2b74540bc7b1096f564****</Id>
    </WaterMarkTemplateList>
</QueryWaterMarkTemplateListResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "17079AF5-6276-51A9-B755-D26594C93F3C",
  "NonExistWids" : [ "72dfa5e679ab4be9a3ed9974c736****" ],
  "WaterMarkTemplateList" : [ {
    "Type" : "Image",
    "RatioRefer" : {
      "Dx" : "0.51",
      "Width" : "0.36",
      "Height" : "0.33",
      "Dy" : "0.4"
    },
    "ReferPos" : "TopRight",
    "State" : "Normal",
    "Dx" : "100",
    "Width" : "8",
    "Height" : "8",
    "Timeline" : {
      "Start" : "0",
      "Duration" : "10"
    },
    "Name" : "example-watermark",
    "Dy" : "100",
    "Id" : "3780bd69b2b74540bc7b1096f564****"
  } ]
}

Error codes

For a list of error codes, visit the Error Center.