PullEvents

Last updated: 2020-03-27 18:45:45

1. API Description

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

  • This API is used to get event notifications from the business server through reliable callback;
  • The API is in long polling mode, i.e., if there is an unconsumed event on the server, it will be immediately returned to the requester; otherwise, the backend will suspend the request until a new event is generated;
  • The request can be suspended for 5 seconds at most. It is recommended that the requester set the timeout period to 10 seconds.
  • If the API returns an event, the caller must call the ConfirmEvents API within 30 seconds to confirm that the event notification has been processed; otherwise, the event notification will be pulled again after 30 seconds.

A maximum of 100 requests can be initiated per second for this API.

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 parameter. The value used for this API: PullEvents.
Version Yes String Common parameter. The value used for this API: 2018-07-17.
Region No String Common parameter. This parameter is not required for this API.
ExtInfo No String Reserved field for special purposes.
SubAppId No Integer Subapplication ID in VOD. If you need to access a resource in a subapplication, enter the subapplication ID in this field; otherwise, leave it empty.

3. Output Parameters

Parameter Name Type Description
EventSet Array of EventContent List of events.
Note: this field may return null, indicating that no valid values can be obtained.
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Pulling an event

Input Example

https://vod.tencentcloudapi.com/?Action=PullEvents
&<Common request parameters>

Output Example

{
  "Response": {
    "EventSet": [
      {
        "EventHandle": "EventHandle1",
        "EventType": "ProcedureStateChanged",
        "FileUploadEvent": null,
        "ProcedureStateChangeEvent": {
          "TaskId": "1256768367-Procedure-475b7237438a39560b9879a4556cb177t1",
          "Status": "FINISH",
          "ErrCode": 0,
          "Message": "",
          "FileId": "5285890784246869930",
          "FileName": "small",
          "FileUrl": "https://123.vod2.myqcloud.com/d042887avodtransgzp1256768367/c643347c5285890784246869930/1546950643_4191274987.100_0.jpg",
          "MetaData": {
            "AudioDuration": 59.990001678467,
            "AudioStreamSet": [
              {
                "Bitrate": 383854,
                "Codec": "aac",
                "SamplingRate": 48000
              }
            ],
            "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
              }
            ],
            "Width": 640
          },
          "MediaProcessResultSet": [
            {
              "Type": "Transcode",
              "TranscodeTask": {
                "Status": "SUCCESS",
                "ErrCode": 0,
                "Message": "SUCCESS",
                "Input": {
                  "Definition": 20,
                  "WatermarkSet": null
                },
                "Output": {
                  "Url": "http://123.vod2.myqcloud.com/d042887avodtransgzp1256768367/c643347c5285890784246869930/v.f20.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
                    }
                  ],
                  "AudioStreamSet": [
                    {
                      "Bitrate": 48491,
                      "Codec": "aac",
                      "SamplingRate": 44100
                    }
                  ],
                  "Definition": 0
                }
              },
              "AnimatedGraphicTask": null,
              "SnapshotByTimeOffsetTask": null,
              "SampleSnapshotTask": null,
              "ImageSpriteTask": null,
              "CoverBySnapshotTask": null
            },
            {
              "Type": "CoverBySnapshot",
              "TranscodeTask": null,
              "AnimatedGraphicTask": null,
              "SnapshotByTimeOffsetTask": null,
              "SampleSnapshotTask": null,
              "ImageSpriteTask": null,
              "CoverBySnapshotTask": {
                "Status": "SUCCESS",
                "ErrCode": 0,
                "Message": "SUCCESS",
                "Input": {
                  "Definition": 10,
                  "PositionType": "Time",
                  "PositionValue": 0,
                  "WatermarkSet": null
                },
                "Output": {
                  "CoverUrl": "http://123.vod2.myqcloud.com/d042887avodtransgzp1256768367/c643347c5285890784246869930/1546950643_4191274987.100_0.jpg"
                }
              }
            }
          ],
          "AiContentReviewResultSet": null,
          "AiRecognitionResultSet": null
        },
        "FileDeleteEvent": null,
        "PullCompleteEvent": null,
        "EditMediaComplete": null,
        "WechatPublishComplete": null,
        "TranscodeCompleteEvent": null,
        "ConcatCompleteEvent": null,
        "ClipCompleteEvent": null,
        "CreateImageSpriteCompleteEvent": null,
        "SnapshotByTimeOffsetCompleteEvent": null
      },
      {
        "EventHandle": "EventHandle2",
        "EventType": "NewFileUpload",
        "FileUploadEvent": {
          "FileId": "5285890784273533167",
          "MediaBasicInfo": {
            "Name": "small2",
            "Description": "",
            "CreateTime": "2019-01-09T16:36:22Z",
            "UpdateTime": "2019-01-09T16:36:24Z",
            "ExpireTime": "9999-12-31T23:59:59Z",
            "ClassId": 0,
            "ClassName": "Other",
            "ClassPath": "Other",
            "CoverUrl": "",
            "Type": "mp4",
            "MediaUrl": "http://123.vod2.myqcloud.com/1c1ae5d2vodgzp1256768367/9ce0cd925285890784273533167/q1BORBPQH1IA.mp4",
            "TagSet": [],
            "StorageRegion": "ap-guangzhou-2",
            "SourceInfo": {
              "SourceType": "Upload",
              "SourceContext": ""
            },
            "Vid": "5285890784273533167"
          },
          "ProcedureTaskId": ""
        },
        "ProcedureStateChangeEvent": null,
        "FileDeleteEvent": null,
        "PullCompleteEvent": null,
        "EditMediaComplete": null,
        "WechatPublishComplete": null,
        "TranscodeCompleteEvent": null,
        "ConcatCompleteEvent": null,
        "ClipCompleteEvent": null,
        "CreateImageSpriteCompleteEvent": null,
        "SnapshotByTimeOffsetCompleteEvent": null
      },
      {
        "EventHandle": "EventHandle3",
        "EventType": "ProcedureStateChanged",
        "FileUploadEvent": null,
        "ProcedureStateChangeEvent": {
          "TaskId": "1256768367-procedurev2-49dfbaea6786dd78ecf70d6256c7ec20t0",
          "Status": "FINISH",
          "ErrCode": 0,
          "Message": "",
          "FileId": "5285890784273533167",
          "FileName": "small2",
          "FileUrl": "http://123.vod2.myqcloud.com/1c1ae5d2vodgzp1256768367/9ce0cd925285890784273533167/q1BORBPQH1IA.mp4",
          "MetaData": {
            "AudioDuration": 59.990001678467,
            "AudioStreamSet": [
              {
                "Bitrate": 383854,
                "Codec": "aac",
                "SamplingRate": 48000
              }
            ],
            "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
              }
            ],
            "Width": 640
          },
          "MediaProcessResultSet": [
            {
              "Type": "SampleSnapshot",
              "TranscodeTask": null,
              "AnimatedGraphicTask": null,
              "SnapshotByTimeOffsetTask": null,
              "SampleSnapshotTask": {
                "Status": "SUCCESS",
                "ErrCode": 0,
                "Message": "SUCCESS",
                "Input": {
                  "Definition": 10,
                  "WatermarkSet": null
                },
                "Output": {
                  "ImageUrlSet": [
                    "http://123.vod2.myqcloud.com/d042887avodtransgzp1256768367/9ce0cd925285890784273533167/1547051785_1651252995.100_0.jpg",
                    "http://123.vod2.myqcloud.com/d042887avodtransgzp1256768367/9ce0cd925285890784273533167/1547051785_1651252995.100_6000.jpg",
                    "http://123.vod2.myqcloud.com/d042887avodtransgzp1256768367/9ce0cd925285890784273533167/1547051785_1651252995.100_12000.jpg",
                    "http://123.vod2.myqcloud.com/d042887avodtransgzp1256768367/9ce0cd925285890784273533167/1547051785_1651252995.100_18000.jpg",
                    "http://123.vod2.myqcloud.com/d042887avodtransgzp1256768367/9ce0cd925285890784273533167/1547051785_1651252995.100_24000.jpg",
                    "http://123.vod2.myqcloud.com/d042887avodtransgzp1256768367/9ce0cd925285890784273533167/1547051785_1651252995.100_30000.jpg",
                    "http://123.vod2.myqcloud.com/d042887avodtransgzp1256768367/9ce0cd925285890784273533167/1547051785_1651252995.100_36000.jpg",
                    "http://123.vod2.myqcloud.com/d042887avodtransgzp1256768367/9ce0cd925285890784273533167/1547051785_1651252995.100_42000.jpg",
                    "http://123.vod2.myqcloud.com/d042887avodtransgzp1256768367/9ce0cd925285890784273533167/1547051785_1651252995.100_48000.jpg",
                    "http://123.vod2.myqcloud.com/d042887avodtransgzp1256768367/9ce0cd925285890784273533167/1547051785_1651252995.100_54000.jpg"
                  ],
                  "Definition": 0,
                  "SampleType": "",
                  "Interval": 0,
                  "WaterMarkDefinition": null
                }
              },
              "ImageSpriteTask": null,
              "CoverBySnapshotTask": null
            }
          ],
          "AiContentReviewResultSet": null,
          "AiRecognitionResultSet": null
        },
        "FileDeleteEvent": null,
        "PullCompleteEvent": null,
        "EditMediaComplete": null,
        "WechatPublishComplete": null,
        "TranscodeCompleteEvent": null,
        "ConcatCompleteEvent": null,
        "ClipCompleteEvent": null,
        "CreateImageSpriteCompleteEvent": null,
        "SnapshotByTimeOffsetCompleteEvent": null
      },
      {
        "EventHandle": "EventHandle4",
        "EventType": "EditMediaComplete",
        "FileUploadEvent": null,
        "ProcedureStateChangeEvent": null,
        "FileDeleteEvent": null,
        "PullCompleteEvent": null,
        "EditMediaCompleteEvent": {
          "TaskId": "1256768367-procedurev2-1b0c3f17fad2f81a5327b57f1005e115t0",
          "Status": "FINISH",
          "ErrCode": 0,
          "Message": "",
          "Input": {
            "InputType": "ConcatFiles",
            "FileInfoSet": [
              {
                "FileId": "",
                "StartTimeOffset": 1,
                "EndTimeOffset": 5
              }
            ],
            "StreamInfoSet": null
          },
          "Output": {
            "FileType": "",
            "FileId": "15517827183909093239",
            "FileUrl": "http://1256768367.vod2.myqcloud.com/1c1ae5d2vodgzp1256768367/e0a739c115517827183909093239/clip.mp4"
          },
          "ProcedureTaskId": ""
        },
        "WechatPublishComplete": null,
        "TranscodeCompleteEvent": null,
        "ConcatCompleteEvent": null,
        "ClipCompleteEvent": null,
        "CreateImageSpriteCompleteEvent": null,
        "SnapshotByTimeOffsetCompleteEvent": null
      }
    ],
    "RequestId": "335bdaa3-db0e-46ce-9946-51941d9cb0f5"
  }
}

5. Developer Resources

API Explorer

This tool allows online call, signature authentication, SDK code generation and quick search of APIs to greatly improve the efficiency of using TencentCloud APIs.

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.
InternalError Internal error.
InvalidParameterValue Incorrect parameter value.
ResourceNotFound The resource does not exist.
UnauthorizedOperation Unauthorized operation.