Querying a Watermark Template
Function
This API is used to query the details of a watermark template.
Calling Method
For details, see Calling APIs.
URI
GET /v1/{project_id}/watermark/templates/{id}
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
| id | Yes | String | Definition Template ID. Constraints The value is returned after the creation succeeds. Range Length: 1 to 128 characters Default Value N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | No | String | User token. This parameter is mandatory when token authentication is used. The token can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
| Authorization | No | String | Authentication information. This parameter is mandatory for AK/SK authentication. |
| X-Sdk-Date | No | String | Time when the request is sent. This parameter is mandatory for AK/SK authentication. |
| X-Project-Id | No | String | Project ID. This parameter is mandatory for AK/SK authentication. |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| X-request-id | String | Request ID for task tracing. Format: request_id-timestamp-hostname. (request_id is the UUID generated on the server. timestamp is the current timestamp. hostname is the name of the server that handles the current request.) |
| Parameter | Type | Description |
|---|---|---|
| name | String | Definition Watermark template name. Constraints N/A Range Length: 1 to 255 characters Default Value N/A |
| type | Integer | Definition Watermark type. Constraints N/A Default Value N/A Value range: 0~2 |
| description | String | Definition Template description. Constraints N/A Range Length: 0 to 512 characters Default Value N/A |
| picture_url | String | Definition Image download path. Constraints
Range Length: 1 to 2,048 characters Default Value N/A |
| width | Number | Definition
Constraints
Default Value N/A Value range: 0~4096 |
| height | Number | Definition Watermark image height. Options:
Constraints
Default Value N/A Value range: 0~4096 |
| location | WatermarkLocation object | Definition Watermark position. Constraints N/A |
| text | WordWaterMarkInfo object | Definition Text watermark information. Constraints N/A |
| scene | String | Definition Service type. Constraints Modification is not supported. Range Default value: cloud_live |
| Parameter | Type | Description |
|---|---|---|
| format | String | Definition Text content. Constraints This parameter is mandatory when type is set to 1 or 2. This parameter is optional when type is set to 0. Range Length: 1 to 64 characters Default Value N/A |
| font_color | String | Definition Text color. Constraints N/A Range Parameter verification: The value must start with a #, followed by 6 or 8 characters. Only digits (0–9), uppercase letters (A–F), and lowercase letters (a–f) are allowed. [Verification is mandatory. If the input is invalid, the text will be displayed in white by default.] Default value: #000000 |
| font_size | Integer | Definition Font size. Constraints N/A Value range: 4~72 Default value: 14 |
| font | String | Definition Font. Constraints N/A Range Length: 1 to 20 characters Default Value By default, the value is blank. |
| time_zone | String | Definition Time zone. Constraints N/A Range The value ranges from UTC-1200 to UTC+1200. The first three characters are UTC, the fourth character is + or -, the fifth and sixth characters indicate the hour, and the seventh and eighth characters are fixed at 00. Default value: UTC+0800 |
| shadow_color | String | Definition Shadow color. Constraints N/A Range Parameter verification: The value must start with a #, followed by 6 or 8 characters. Only digits (0–9), uppercase letters (A–F), and lowercase letters (a–f) are allowed. [Verification is mandatory. If the input is invalid, the text will be displayed in black by default.] Default Value The default value is none. |
| location | WatermarkLocation object | Definition Location. Constraints It is mandatory. |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| X-request-id | String | Request ID for task tracing. Format: request_id-timestamp-hostname. (request_id is the UUID generated on the server. timestamp is the current timestamp. hostname is the name of the server that handles the current request.) |
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. |
| error_msg | String | Error description. |
Example Requests
GET https://{endpoint}/v1/{project_id}/watermark/templates/e89b76xxxxxx3425ui80af501cdxxxxxx Example Responses
Status code: 200
Watermark templates queried.
{
"name" : "MyWatermarkTemplate",
"type" : 0,
"description" : "my demo template",
"picture_url" : "http://example.com/picture",
"width" : 0.1,
"height" : 0.1,
"location" : {
"location" : "TOPLEFT",
"x_offset" : 20,
"y_offset" : 10
}
} Status code: 400
Watermark template query failed.
{
"error_code" : "LIVE.100011001",
"error_msg" : "Request Illegal"
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Watermark templates queried. |
| 400 | Watermark template query failed. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.