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. Range Length: 1 to 255 characters |
| type | Integer | Definition Watermark type. Value range: 0~2 |
| description | String | Definition Template description. Range Length: 0 to 512 characters |
| picture_url | String | Definition Image download path. Range Length: 1 to 2,048 characters |
| width | Number | Definition
0, the original width and height of the watermark image are used.
Value range: 0~4096 |
| height | Number | Definition Watermark image height. Options:
0, the original width and height of the watermark image are used.
Value range: 0~4096 |
| location | WatermarkLocation object | Definition Watermark position. |
| text | WordWaterMarkInfo object | Definition Text watermark information. |
| scene | String | Definition Service attribute. Range |
| Parameter | Type | Description |
|---|---|---|
| format | String | Definition Text content. type is set to 1 or 2. This parameter is optional when type is set to 0. Range Length: 1 to 64 characters |
| font_color | String | Definition Text color. 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.] |
| font_size | Integer | Definition Font size. Value range: 4~72 |
| font | String | Definition Font. Range Length: 1 to 20 characters |
| time_zone | String | Definition Time zone. 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. |
| shadow_color | String | Definition Shadow color. 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.] none. |
| location | WatermarkLocation object | Definition Location. |
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.