Overview
Menu

ParseNotification

1. API Description

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

This API is used to parse the content of an MPS event notification from the msgBody field in the message received from CMQ.
Instead of initiating a video processing task, this API is used to help generate SDKs for various programming languages. You can parse the event notification based on the analytic function of the SDKs.

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 NameRequiredTypeDescription
ActionYesStringCommon Params. The value used for this API: ParseNotification.
VersionYesStringCommon Params. The value used for this API: 2019-06-12.
RegionNoStringCommon Params. This parameter is not required for this API.
ContentYesStringEvent notification obtained from CMQ.

3. Output Parameters

Parameter NameTypeDescription
EventTypeStringThe event type. Valid values:
  • WorkflowTask
  • EditMediaTask
  • ScheduleTask (scheme)
  • WorkflowTaskEventWorkflowTaskThe information of a video processing task. Information will be returned only if EventType is WorkflowTask.
    Note: This field may return null, indicating that no valid values can be obtained.
    EditMediaTaskEventEditMediaTaskThe information of a video editing task. Information will be returned only if EventType is EditMediaTask.
    Note: This field may return null, indicating that no valid values can be obtained.
    SessionIdStringThe ID used for deduplication. If there was a request with the same ID in the last seven days, the current request will return an error. The ID can contain up to 50 characters. If this parameter is left empty or an empty string is entered, no deduplication will be performed.
    SessionContextStringThe source context which is used to pass through the user request information. The task flow status change callback will return the value of this field. It can contain up to 1,000 characters.
    ScheduleTaskEventScheduleTaskThe information of a scheme. Information will be returned only if EventType is ScheduleTask.
    Note: This field may return null, indicating that no valid values can be obtained.
    TimestampInteger- The expiration time (Unix timestamp) of the notification's signature.
    - By default, notifications sent by MPS expire after 10 minutes. If the expiration time specified has elapsed, a notification will be considered invalid. This can prevent replay attacks.
    - The format of this parameter is a decimal Unix timestamp, i.e., the number of seconds that have elapsed since 00:00 (UTC/GMT time) on January 1, 1970.
    SignStringThe notification signature. Sign = MD5 (Timestamp + NotifyKey) MPS concatenates Timestamp and NotifyKey in TaskNotifyConfig and calculates a signature using the MD5 algorithm. This signature is included in the notification sent to your backend server. If the signature in the notification matches your own calculation result, it indicates that the notification is from MPS.
    RequestIdStringThe unique request ID, which is returned for each request. 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.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
                        }
                    ],
                    "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": "abc",
                            "ColorSpace": "abc",
                            "ColorTransfer": "abc",
                            "HdrType": "abc"
                        }
                    ],
                    "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": {
                                "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": "abc",
                                        "ColorSpace": "abc",
                                        "ColorTransfer": "abc",
                                        "HdrType": "abc"
                                    }
                                ],
                                "AudioStreamSet": [
                                    {
                                        "Bitrate": 48491,
                                        "Codec": "aac",
                                        "SamplingRate": 44100,
                                        "Channel": 0
                                    }
                                ],
                                "Definition": 0
                            }
                        },
                        "AnimatedGraphicTask": null,
                        "SnapshotByTimeOffsetTask": null,
                        "SampleSnapshotTask": null,
                        "ImageSpriteTask": 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 CodeDescription
    FailedOperationOperation failed.
    FailedOperation.InvalidMpsUserOperation failed: unauthorized MPS user.
    InvalidParameterParameter error.
    InvalidParameterValue.InvalidContentThe value of the parsed Content is invalid.