tencent cloud

APIs

ParseNotification

Download
Modo Foco
Tamanho da Fonte
Última atualização: 2026-08-14 16:33:20

1. API Description

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

After receiving a message from CMQ, parse out the content of the MPS event notification from the msgBody field of the message.
This API is not used to trigger network calls, but to help generate SDKs for each language platform. You can refer to the parsing function in the SDK to implement event notification parsing.

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: ParseNotification.
Version Yes String Common Params. The value used for this API: 2019-06-12.
Region No String Common Params. This parameter is not required for this API.
Content Yes String Event notification content obtained from CMQ.

3. Output Parameters

Parameter Name Type Description
EventType String Supported event types. Currently, the valid values include:
  • WorkflowTask: video workflow processing task.
  • EditMediaTask: video editing task.
  • ScheduleTask: Orchestration task.
  • WorkflowTaskEvent WorkflowTask
    EditMediaTaskEvent EditMediaTask
    SessionId String An identifier for deduplication. If there has been a request with the same identifier within the past seven days, an error will be returned for the current request. The maximum length is 50 characters. Leaving it blank or using a null string indicates no deduplication is required.
    SessionContext String Source context, which is used to pass through user request information. The callback for task flow status changes will return the value of this field. The maximum length is 1,000 characters.
    ScheduleTaskEvent ScheduleTask
    Timestamp Integer -Expiration time, event notification signature expiration UNIX timestamp.
    -The default expiration time for notifications from Media Processing Service (MPS) is 10 minutes. If the time specified by the Timestamp value in a message notification has expired, the notification can be deemed invalid, which helps prevent network replay attacks.
    -Timestamp is in decimal UNIX Timestamp format, which is the seconds elapsed since midnight (UTC/GMT) on January 1, 1970.
    Sign String Event notification security signature. Sign = MD5 (Timestamp + NotifyKey). Note: Media Processing Service concatenates Timestamp and NotifyKey from TaskNotifyConfig as a string and calculates the Sign value through MD5. This value is included in the notification message. Your backend server can verify whether the Sign is correct using the same algorithm, to confirm whether the message is indeed from the Media Processing Service backend.
    BatchTaskEvent BatchSubTaskResult
    ExtractBlindWatermarkTask ExtractBlindWatermarkTask
    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 Parsing an Event Notification

    This example shows you how to parse an event notification.

    Input Example

    POST / HTTP/1.1
    Host: mps.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: ParseNotification
    <Common request parameters>
    
    {
        "Content": "{\"EventType\":\"ProcedureStateChanged\",XXX"
    }

    Output Example

    {
        "Response": {
            "EventType": "WorkflowTask",
            "WorkflowTaskEvent": {
                "TaskId": "1256768367-Procedure-475b7237438a39560b9879a4556cb177t1",
                "Status": "FINISH",
                "ErrCode": 0,
                "Message": "",
                "InputInfo": {
                    "Type": "COS",
                    "CosInputInfo": {
                        "Bucket": "TopRankVideo-125xxx88",
                        "Region": "ap-chongqing",
                        "Object": "/movie/201907/WildAnimal.mov"
                    },
                    "UrlInputInfo": null,
                    "S3InputInfo": null
                },
                "MetaData": {
                    "AudioDuration": 59.990001678467,
                    "AudioStreamSet": [
                        {
                            "Bitrate": 383854,
                            "SamplingRate": 48000,
                            "Codec": "aac",
                            "Channel": 0,
                            "Loudness": 0,
                            "Codecs": "mp4a.40.2"
                        }
                    ],
                    "Bitrate": 1021028,
                    "Container": "mov,mp4,m4a,3gp,3g2,mj2",
                    "Duration": 60,
                    "Height": 480,
                    "Rotate": 0,
                    "Size": 7700180,
                    "VideoDuration": 60,
                    "VideoStreamSet": [
                        {
                            "Bitrate": 637174,
                            "Codec": "h264",
                            "Fps": 23,
                            "Height": 480,
                            "Width": 640,
                            "ColorPrimaries": "bt470bg",
                            "ColorSpace": "gbr",
                            "ColorTransfer": "bt709",
                            "HdrType": "sdr",
                            "Codecs": "avc1.ffe100"
                        }
                    ],
                    "Width": 640
                },
                "MediaProcessResultSet": [
                    {
                        "Type": "Transcode",
                        "TranscodeTask": {
                            "Status": "SUCCESS",
                            "ErrCodeExt": "SUCCESS",
                            "ErrCode": 0,
                            "Message": "SUCCESS",
                            "Progress": 0,
                            "Input": {
                                "Definition": 20,
                                "WatermarkSet": null,
                                "OutputObjectPath": "",
                                "RawParameter": null,
                                "StartTimeOffset": 0,
                                "EndTimeOffset": 0,
                                "OverrideParameter": null,
                                "ObjectNumberFormat": null,
                                "OutputStorage": null,
                                "SegmentObjectName": "",
                                "HeadTailParameter": null,
                                "MosaicSet": []
                            },
                            "Output": {
                                "OutputStorage": {
                                    "Type": "COS",
                                    "CosOutputStorage": {
                                        "Bucket": "test-123",
                                        "Region": "ap-nanjing"
                                    },
                                    "S3OutputStorage": {
                                        "S3Bucket": "test-223",
                                        "S3Region": "us-east-1",
                                        "S3SecretId": "TEST**************K5W",
                                        "S3SecretKey": "testab****************0SS"
                                    }
                                },
                                "Path": "/movie/201907/WildAnimal_transcode_20.mp4",
                                "Size": 4189073,
                                "Container": "mov,mp4,m4a,3gp,3g2,mj2",
                                "Height": 480,
                                "Width": 640,
                                "Bitrate": 552218,
                                "Md5": "eff7031ad7877865f9a3240e9ab165ad",
                                "Duration": 60.04700088501,
                                "VideoStreamSet": [
                                    {
                                        "Bitrate": 503727,
                                        "Codec": "h264",
                                        "Fps": 24,
                                        "Height": 480,
                                        "Width": 640,
                                        "ColorPrimaries": "bt470bg",
                                        "ColorSpace": "gbr",
                                        "ColorTransfer": "bt709",
                                        "HdrType": "sdr",
                                        "Codecs": "avc1.ffe100"
                                    }
                                ],
                                "AudioStreamSet": [
                                    {
                                        "Bitrate": 48491,
                                        "Codec": "aac",
                                        "SamplingRate": 44100,
                                        "Channel": 0,
                                        "Loudness": 0,
                                        "Codecs": "mp4a.40.2"
                                    }
                                ],
                                "Definition": 0
                            }
                        },
                        "AnimatedGraphicTask": null,
                        "SnapshotByTimeOffsetTask": null,
                        "SampleSnapshotTask": null,
                        "ImageSpriteTask": null,
                        "AdaptiveDynamicStreamingTask": null
                    }
                ],
                "AiQualityControlTaskResult": null,
                "AiAnalysisResultSet": [],
                "AiRecognitionResultSet": [],
                "AiContentReviewResultSet": []
            },
            "RequestId": "335bdaa3-db0e-46ce-9946-51941d9cb0f5",
            "ScheduleTaskEvent": null,
            "EditMediaTaskEvent": null,
            "SessionId": "",
            "SessionContext": ""
        }
    }

    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.InvalidMpsUser Operation failed: unauthorized MPS user.
    InvalidParameter Parameter error.
    InvalidParameterValue.InvalidContent The value of Content is invalid.

    Ajuda e Suporte

    Esta página foi útil?

    comentários