tencent cloud

Feedback

CreateWatermarkTemplate

Last updated: 2024-03-27 16:08:21

    1. API Description

    Domain name for API request: vod.tencentcloudapi.com.

    This API is used to create a custom watermarking template. Up to 1,000 templates can be created.

    A maximum of 100 requests can be initiated per second for this API.

    We recommend you to use API Explorer
    Try it
    API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

    2. Input Parameters

    The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

    Parameter Name Required Type Description
    Action Yes String Common Params. The value used for this API: CreateWatermarkTemplate.
    Version Yes String Common Params. The value used for this API: 2018-07-17.
    Region No String Common Params. This parameter is not required.
    Type Yes String Watermarking type. Valid values:
  • image: image watermark;
  • text: text watermark;
  • svg: SVG watermark.
  • SubAppId No Integer The VOD application ID. For customers who activate VOD service from December 25, 2023, if they want to access resources in a VOD application (whether it's the default application or a newly created one), they must fill in this field with the application ID.
    Name No String Watermarking template name. Length limit: 64 characters.
    Comment No String Template description. Length limit: 256 characters.
    CoordinateOrigin No String Origin position. Valid values:
  • TopLeft: the origin of coordinates is in the top-left corner of the video, and the origin of the watermark is in the top-left corner of the image or text;
  • TopRight: the origin of coordinates is in the top-right corner of the video, and the origin of the watermark is in the top-right corner of the image or text;
  • BottomLeft: the origin of coordinates is in the bottom-left corner of the video, and the origin of the watermark is in the bottom-left corner of the image or text;
  • BottomRight: the origin of coordinates is in the bottom-right corner of the video, and the origin of the watermark is in the bottom-right corner of the image or text.

  • Default value: TopLeft.
    XPos No String The horizontal position of the origin of the watermark relative to the origin of coordinates of the video. % and px formats are supported:
  • If the string ends in %, the XPos of the watermark will be the specified percentage of the video width; for example, 10% means that XPos is 10% of the video width;
  • If the string ends in px, the XPos of the watermark will be the specified px; for example, 100px means that XPos is 100 px.

  • Default value: 0 px.
    YPos No String The vertical position of the origin of the watermark relative to the origin of coordinates of the video. % and px formats are supported:
  • If the string ends in %, the YPos of the watermark will be the specified percentage of the video height; for example, 10% means that YPos is 10% of the video height;
  • If the string ends in px, the YPos of the watermark will be the specified px; for example, 100px means that YPos is 100 px.

  • Default value: 0 px.
    ImageTemplate No ImageWatermarkInput Image watermarking template. This field is required when Type is image and is invalid when Type is text.
    TextTemplate No TextWatermarkTemplateInput Text watermarking template. This field is required when Type is text and is invalid when Type is image.
    SvgTemplate No SvgWatermarkInput SVG watermarking template. This field is required when Type is svg and is invalid when Type is image or text.

    3. Output Parameters

    Parameter Name Type Description
    Definition Integer Unique ID of watermarking template.
    ImageUrl String Watermark image address. This field is valid only when Type is image.
    RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

    4. Example

    Example1 Creating a watermark template

    Input Example

    https://vod.tencentcloudapi.com/?Action=CreateWatermarkTemplate
    &Type=image
    &Name=Template 1
    &ImageTemplate.ImageContent=/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxITEhUSEhIVFRUXFRUXFxcYFRUVFRUXFxUXFhUVFxUYHSggGBolHRUXITEhJSkrLi4uFx8zODMtNygtLisBCgoKDg0OGhAQFy0dHx4tLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLTEtLS0tLS0rLS0tKystLf/AABEIAOEA4AMBIgACEQEDEQH/xAAcAAAABwEBAAAAAAAAAAAAAAAAAQIDBAUGBwj/xABBEAABAwIDBAYHBQYGAwAAAAABAAIRAwQFITESQVFhBiJxkbHREzJTgaHB8BRCUpKTByNigrLxFTRDcsLhM1Rz/8QAGQEAAgMBAAAAAAAAAAAAAAAAAQIAAwQF/8QAJBEAAgIBBAICAwEAAAAAAAAAAAECEQMSITFBBFEiMhMjYXH/2gAMAwEAAhEDEQA/AIX2+t7ar+o/zRfb63tqv6j/ADTUIQtBjsd+31vbVf1H+aL7fX9tV/Uf5pqEIQJY7/iFb21X9R/mh9vr+2q/qP8ANMwgQpRLHf8AEK3tqv6j/NGMQr+2q/qP80zCEKEski/re2q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FOV0ViS/RBBVMtRjcT/wDIVXVNUaCpkaIcBUNU/wAEEEiGY4dFJtvWZ/vb/UESCZCs9T2+gTqCCD5GXASyfS7/AMzP9jv6gggqs30Zdh+xSnROhBBY2beyLdfNVlT5o0FX2ErKytuiP+cp/wA39KCCvx/ZFc/qzp196qi0tEaC6SOccu/aX6r/AK3rkFb1j2oIJZEQ2jQQSjD7Uh6CCgF2aHoN65W7r+qUEFqhwZZ8n//Z
    &<Common request parameters>
    

    Output Example

    {
        "Response": {
            "Definition": 1001,
            "ImageUrl": "http://1256768367.vod2.myqcloud.com/8b0dd2b5vodcq1256768367/4d27b39f5285890783754292994/aa.jpeg",
            "RequestId": "12ae8d8e-dce3-4151-9d4b-5594145287e1"
        }
    }
    

    5. Developer Resources

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    FailedOperation Operation failed.
    FailedOperation.InvalidVodUser The VOD service is not activated.
    InternalError Internal error.
    InternalError.GenDefinition Internal error: failed to generate template ID.
    InternalError.UploadWatermarkError Internal error: failed to upload watermark image.
    InvalidParameterValue.Comment Invalid parameter: template description.
    InvalidParameterValue.CoordinateOrigin Incorrect parameter value: CoordinateOrigin.
    InvalidParameterValue.Height Invalid parameter: height.
    InvalidParameterValue.ImageContent Invalid ImageContent.
    InvalidParameterValue.ImageTemplate Invalid parameter: image watermarking template.
    InvalidParameterValue.Name Incorrect parameter value: Name exceeds the length limit.
    InvalidParameterValue.RepeatType Invalid parameter: invalid RepeatType.
    InvalidParameterValue.SvgTemplate Incorrect parameter value: SVG is empty.
    InvalidParameterValue.SvgTemplateHeight Incorrect parameter value: SVG height.
    InvalidParameterValue.SvgTemplateWidth Incorrect parameter value: SVG width.
    InvalidParameterValue.TextAlpha Invalid parameter: text transparency.
    InvalidParameterValue.TextTemplate Invalid parameter: text template.
    InvalidParameterValue.Type Incorrect Type parameter value.
    InvalidParameterValue.Width Invalid parameter: width.
    InvalidParameterValue.XPos The horizontal position of the origin of the watermark relative to the origin of coordinates of the video. % and px formats are supported.
    InvalidParameterValue.YPos The vertical position of the origin of the watermark relative to the origin of coordinates of the video. % and px formats are supported.
    LimitExceeded.TooMuchTemplate Limit exceeded: The number of templates exceeds the upper limit of 100. If you need more, pleaseSubmit a ticket
    UnauthorizedOperation Unauthorized operation.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support