This topic describes the UploadByURLComplete event for transcoded stream uploads, including its notification content and callback examples.
Event type
UploadByURLComplete
The event type is the same as the event for a completed video upload from a URL. However, the event for a transcoded stream includes two additional parameters: `FileType` and `StreamFileURL`.
Event description
Submitting an UploadStreamByURL job generates the `UploadByURLComplete` event after the transcoded stream upload is complete.
Event content
Parameter Name | Type | Required | Description |
EventTime | String | Yes | The time when the event was generated. The time is in UTC and follows the yyyy-MM-ddTHH:mm:ssZ format. |
EventType | String | Yes | The type of event. This is a required parameter. The value is fixed to UploadByURLComplete. |
VideoId | String | Yes | The ID of the video to which the transcoded stream is attached. |
JobId | String | Yes | The ID of the transcoding stream job. |
SourceURL | String | Yes | The URL of the source file. |
FileType | String | Yes | The file type. This parameter identifies the callback message for the stream pull job. The value is fixed to Stream. |
Status | String | Yes | Upload the results.
|
StreamFileURL | String | No | The Object Storage Service (OSS) URL of the transcoded stream file. This parameter is returned after the stream is successfully pulled. |
ErrorCode | String | No | The error code. This parameter is returned if an upload error occurs. |
ErrorMessage | String | No | The error message. This parameter is returned if an upload error occurs. |
Extend | String | No | The custom data that is passed through in the callback. For more information, see Request parameters. |
Callback examples
The following is a callback example:
For HTTP callbacks, the following content is the HTTP POST body.
For MNS callbacks, the following content is the message body.
Successful upload
{ "Status":"success", "SourceURL":"https://example.com/record/live/03/2021-09-17-14-06-35_2021-09-17-14-07-29", "VideoId":"0a389969855b438a9eb2a1d1efc0****", "EventType":"UploadByURLComplete", "FileType":"Stream", "EventTime":"2021-12-21T04:04:01Z", "StreamFileURL":"http://outin-31059bcee78111eaa0a200163e1c****.oss-cn-shanghai.aliyuncs.com/0a389969855b438a9eb2a1d1efc0cb9f/5d018d2bc9400d1831f9868a04e4a5f****.flv", "JobId":"5d018d2bc9400d1831f9868a04e4****" }Failed upload
{ "Status":"fail", "SourceURL":"https://example.com/record/live/03/2021-09-17-14-06-35_2021-09-17-14-07", "VideoId":"0a389969855b438a9eb2a1d1efc0****", "EventType":"UploadByURLComplete", "FileType":"Stream", "EventTime":"2021-12-21T04:05:33Z", "ErrorCode":"Fail", "ErrorMessage":"download status code = 404", "JobId":"c0b543f9347452c4d3e220ef3495****" }