Queries watermark templates in the specified state.

Usage notes

You can call this operation to query watermark templates in the specified state. If you do not specify the state, all watermark templates are queried by default.

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 SearchWaterMarkTemplate

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

PageSize Long No 10

The number of entries to return on each page.

  • A maximum of 100 entries can be returned on each page.
  • Default value: 10.
PageNumber Long No 1

The number of the page to return. Default value: 1.

State String No Normal

The status of the watermark templates that you want to query. Valid values:

  • All: All watermark templates are queried. This is the default value.
  • normal: Normal watermark templates are queried.
  • Deleted: Deleted watermark templates are queried.

Response parameters

Parameter Type Example Description
TotalCount Long 1

The total number of returned entries.

PageSize Long 10

The number of entries returned on each page.

RequestId String FC029D04-8F47-57FF-A759-23383C15617D

The ID of the request.

PageNumber Long 1

The number of the returned page.

WaterMarkTemplateList Array of WaterMarkTemplate

The details of the watermark templates.

WaterMarkTemplate
Type String Image

The type of the watermark. Valid values:

  • Image: an image watermark.
  • Text: a text watermark.
Note Only watermarks of the Image types 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.2

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 ToEND

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 88c6ca184c0e4578645b665e2a12****

The ID of the watermark template.

Examples

Sample requests

http(s)://mts.cn-shanghai.aliyuncs.com/?Action=SearchWaterMarkTemplate
&PageSize=10
&PageNumber=1
&State=Normal
&<Common request parameters>

Sample success response

XML format

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

<SearchWaterMarkTemplateResponse>
    <TotalCount>1</TotalCount>
    <PageSize>10</PageSize>
    <RequestId>FC029D04-8F47-57FF-A759-23383C15617D</RequestId>
    <PageNumber>1</PageNumber>
    <WaterMarkTemplateList>
        <Type>Image</Type>
        <RatioRefer>
            <Dx>0.51</Dx>
            <Width>0.36</Width>
            <Height>0.33</Height>
            <Dy>0.2</Dy>
        </RatioRefer>
        <ReferPos>TopRight</ReferPos>
        <State>Normal</State>
        <Dx>100</Dx>
        <Width>8</Width>
        <Height>8</Height>
        <Timeline>
            <Start>0</Start>
            <Duration>ToEND</Duration>
        </Timeline>
        <Name>example-watermark</Name>
        <Dy>100</Dy>
        <Id>88c6ca184c0e4578645b665e2a12****</Id>
    </WaterMarkTemplateList>
</SearchWaterMarkTemplateResponse>

JSON format

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

{
  "TotalCount" : 1,
  "PageSize" : 10,
  "RequestId" : "FC029D04-8F47-57FF-A759-23383C15617D",
  "PageNumber" : 1,
  "WaterMarkTemplateList" : [ {
    "Type" : "Image",
    "RatioRefer" : {
      "Dx" : "0.51",
      "Width" : "0.36",
      "Height" : "0.33",
      "Dy" : "0.2"
    },
    "ReferPos" : "TopRight",
    "State" : "Normal",
    "Dx" : "100",
    "Width" : "8",
    "Height" : "8",
    "Timeline" : {
      "Start" : "0",
      "Duration" : "ToEND"
    },
    "Name" : "example-watermark",
    "Dy" : "100",
    "Id" : "88c6ca184c0e4578645b665e2a12****"
  } ]
}

Error codes

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