tencent cloud

Feedback

DescribeTaskDetail

Last updated: 2024-11-26 11:55:24

    1. API Description

    Domain name for API request: vm.intl.tencentcloudapi.com.

    This API is used to poll the details of the detection result.

    Default API request rate limit: 200 requests/sec.

    A maximum of 20 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: DescribeTaskDetail.
    Version Yes String Common Params. The value used for this API: 2020-12-29.
    Region No String Common Params. This parameter is not required for this API.
    TaskId Yes String This field indicates the task ID (in the Results parameter) returned after a video moderation task is created. It is used to identify the moderation task for which to query the details.

    Note: the query API can query up to 20 tasks at a time.
    ShowAllSegments No Boolean This boolean field indicates whether to display all video segments. Valid values: True (yes), False (display only video segments that hit the moderation rule). Default value: False.

    3. Output Parameters

    Parameter Name Type Description
    TaskId String This field is used to return the task ID (in the Results parameter) after a video moderation task is created. It is used to identify the moderation task for which to query the details.
    Note: this field may return null, indicating that no valid values can be obtained.
    DataId String This field is used to return the data ID parameter passed in when the video moderation API is called for easier data identification and management.
    Note: this field may return null, indicating that no valid values can be obtained.
    BizType String This field is used to return the BizType parameter passed in when the video moderation API is called for easier data identification and management.
    Note: this field may return null, indicating that no valid values can be obtained.
    Name String This field is used to return the task name in the TaskInput parameter passed in when the video moderation API is called for easier task identification and management.
    Note: this field may return null, indicating that no valid values can be obtained.
    Status String This field is used to return the task status of the queried content.

    Valid values: FINISH (task completed), PENDING (task pending), RUNNING (task in progress), ERROR (task error), CANCELLED (task canceled).
    Note: this field may return null, indicating that no valid values can be obtained.
    Type String This field is used to return the type of video for moderation. Valid values: VIDEO (video on demand), LIVE_VIDEO (video live streaming). Default value: VIDEO.
    Note: This field may return null, indicating that no valid value can be obtained.
    Suggestion String This field is used to return the operation suggestion for the maliciousness tag. When you get the determination result, the returned value indicates the operation suggested by the system. We recommend you handle different types of violations and suggestions according to your business needs.
    Returned values: Block, Review, Pass.
    Note: this field may return null, indicating that no valid values can be obtained.
    Labels Array of TaskLabel This field is used to return the maliciousness tag in the detection result.
    Values: Normal: normal; Porn: pornographic; Abuse: abusive; Ad: advertising; Custom: custom type of non-compliant content and other offensive, unsafe, or inappropriate types of content.
    Note: This field may return null, indicating that no valid value can be obtained.
    MediaInfo MediaInfo This field is used to return the details of the input media file, including encoding/decoding formats and segment length. For details, see the description of the MediaInfo data structure.
    Note: this field may return null, indicating that no valid values can be obtained.
    InputInfo InputInfo This field is used to return the media content information of the moderation service, mainly including the input file type and access URL.
    Note: this field may return null, indicating that no valid values can be obtained.
    CreatedAt String This field is used to return the creation time of the queried task in ISO 8601 format.
    Note: this field may return null, indicating that no valid values can be obtained.
    UpdatedAt String This field is used to return the last update time of the queried task in ISO 8601 format.
    Note: this field may return null, indicating that no valid values can be obtained.
    ImageSegments Array of ImageSegments This field is used to return the moderation result of the frames captured from the video. For the detailed returned content, see the description of the ImageSegments data structure.
    Note: the data is valid for 24 hours. To extend the storage period, set it in the configured COS bucket.
    Note: this field may return null, indicating that no valid values can be obtained.
    AudioSegments Array of AudioSegments This field is used to return the moderation result of the audio in the video. For the detailed returned content, see the description of the AudioSegments data structure.
    Note: the data is valid for 24 hours. To extend the storage period, set it in the configured COS bucket.
    Note: this field may return null, indicating that no valid values can be obtained.
    ErrorType String When the task status is Error, the type of the error will be returned. Valid values: DECODE_ERROR: decoding failed (the input resource may contain video that cannot be decoded).
    URL_ERROR: download address verification failed.
    TIMEOUT_ERROR: processing timed out. When the task status is not Error, null will be returned by default.
    Note: this field may return null, indicating that no valid values can be obtained.
    ErrorDescription String If the task status is Error, this field will return the error message; otherwise, null will be returned by default.
    Note: this field may return null, indicating that no valid values can be obtained.
    Label String If the recognition result is normal, this parameter is returned with the value Normal. If malicious content is recognized, the tag with the highest priority in the result of Labels is returned.
    Note: This field may return null, indicating that no valid value can be obtained.
    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 Viewing Task Details

    This example shows you how to view the details of a task by TaskId.

    Input Example

    POST / HTTP/1.1
    Host: vm.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeTaskDetail
    <Common request parameters>
    
    {
        "TaskId": "task-video-XwxJtbkKXWgCt8AZ"
    }
    

    Output Example

    {
        "Response": {
            "TaskId": "task-video-XwxJtbkKXWgCt8AZ",
            "DataId": "data_test_01",
            "BizType": "1001",
            "Name": "",
            "Status": "FINISH",
            "Type": "VIDEO",
            "Suggestion": "Block",
            "Labels": [
                {
                    "Label": "Porn",
                    "Suggestion": "Block",
                    "Score": 99,
                    "SubLabel": ""
                },
                {
                    "Label": "Hot",
                    "Suggestion": "Block",
                    "Score": 70,
                    "SubLabel": ""
                }
            ],
            "MediaInfo": {
                "Duration": 36
            },
            "InputInfo": {
                "Type": "URL",
                "Url": "https://cms-video-segments-1256309736.cos.ap-guangzhou.myqcloud.co/huang.mp4",
                "BucketInfo": null
            },
            "CreatedAt": "2020-07-13T11:47:01.925Z",
            "UpdatedAt": "2020-07-13T11:47:25.840Z",
            "ImageSegments": [
                {
                    "Result": {
                        "HitFlag": 1,
                        "Label": "Porn",
                        "SubLabel": "",
                        "Suggestion": "Block",
                        "Score": 85,
                        "Results": [
                            {
                                "Scene": "Porn",
                                "HitFlag": 1,
                                "Suggestion": "Block",
                                "Label": "Porn",
                                "SubLabel": "",
                                "Score": 85,
                                "Names": [],
                                "Text": "",
                                "Details": []
                            }
                        ],
                        "Url": "https://cos.ap-zhou.myqcloud.com/c019/image_1.jpg"
                    },
                    "OffsetTime": "1"
                },
                {
                    "Result": {
                        "HitFlag": 1,
                        "Label": "Porn",
                        "SubLabel": "",
                        "Suggestion": "Block",
                        "Score": 77,
                        "Results": [
                            {
                                "Scene": "Porn",
                                "HitFlag": 1,
                                "Suggestion": "Block",
                                "Label": "Porn",
                                "SubLabel": "",
                                "Score": 77,
                                "Names": [],
                                "Text": "",
                                "Details": []
                            }
                        ],
                        "Url": "https://cos.ap-guau.myqcloud.com/cc49b5b90a5d6802b7c019/image_2.jpg"
                    },
                    "OffsetTime": "2"
                }
            ],
            "AudioSegments": [
                {
                    "Result": {
                        "HitFlag": 0,
                        "Label": "Normal",
                        "SubLabel": "",
                        "Suggestion": "Pass",
                        "Score": 0,
                        "Text": "Test audio text",
                        "Url": "https://xxx.com/7c019/audio_0.mp3",
                        "Duration": "36398"
                    },
                    "OffsetTime": "0"
                }
            ],
            "RequestId": "8d3e4765-48db-40b5-8fdb-aaf1d7225a60",
            "ErrorType": "",
            "ErrorDescription": "",
            "Label": "Porn"
        }
    }
    

    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
    DryRunOperation DryRun operation, which means the DryRun parameter is passed in yet the request will still be successful.
    FailedOperation Operation failed.
    InternalError Internal error.
    InvalidParameter Parameter error.
    InvalidParameterValue Invalid parameter value.
    LimitExceeded The quota limit has been reached.
    MissingParameter Missing parameter.
    OperationDenied Operation denied.
    RequestLimitExceeded The number of requests exceeds the frequency limit.
    ResourceInUse The resource is occupied.
    ResourceInsufficient Insufficient resource.
    ResourceNotFound The resource doesn’t exist.
    ResourceUnavailable The resource is unavailable.
    ResourcesSoldOut The resources have been sold out.
    UnauthorizedOperation Unauthorized operation.
    UnknownParameter Unknown parameter error.
    UnsupportedOperation Unsupported operation.