UploadByURLComplete (for transcoded stream uploads)

Updated at:

ApsaraVideo VOD triggers the UploadByURLComplete event when a transcoded stream upload from a URL is complete. This topic covers the event notification content and callback examples.

Event type

UploadByURLComplete

Note

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

After you submit an UploadStreamByURL job, ApsaraVideo VOD generates the UploadByURLComplete event when 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. 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. Identifies the callback as a stream pull job. The value is fixed to Stream.

Status

String

Yes

The upload result.

  • success: The upload succeeded.

  • fail: The upload failed.

StreamFileURL

String

No

The OSS URL of the transcoded stream file. Returned after the stream is successfully pulled.

ErrorCode

String

No

The error code. Returned if an upload error occurs.

ErrorMessage

String

No

The error message. Returned if an upload error occurs.

Extend

String

No

The custom data passed through in the callback. For more information, see Request parameters.

Callback examples

The following are callback examples:

  • 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****"
    }