Intelligent Media Services (IMS) provides callback events related to features such as media asset upload, media processing, and online editing. You can configure specific callback events to obtain the task progress and status at the earliest opportunity. This topic describes the sample message bodies of different types of events and the corresponding parameter descriptions.
Usage notes
If the callback method of HTTP requests or HTTPS requests is used, the message body examples in this topic are the request body content. If the callback method of Simple Message Queue (SMQ) queues is used, the message body examples in this topic are the message content received by the queues.
Event list
Table 1 Media asset upload
Event | Description |
An audio or video file is uploaded. | |
An audio or video file is uploaded by using the URL of the file. | |
An image is uploaded. | |
An auxiliary media asset is uploaded. | |
A media stream is registered. | |
A media stream is uploaded. | |
A media stream is uploaded by using the URL of the media stream. |
Table 2 Media asset management
Event | Description |
A manual review task is complete. | |
A media asset is registered. | |
A media asset is deleted. | |
The basic information about a media asset is modified. |
Event details
FileUploadComplete: An audio or video file is uploaded
Sample message body:
{
"EventType": "FileUploadComplete",
"UserId": 183322097756****,
"EventTime": "2022-07-15T08:48:14Z",
"MessageBody": {
"Status": "Success",
"FileUrl": "http://outin-***.oss-cn-shanghai.aliyuncs.com/sv/93ad7c5-182010aa3dc/93ad7c5-182010a****.mp4",
"MediaId": "c321b3a0041a71eda1590674a2ce****",
"AppId": "app-1000000",
"Size": "5510872",
"MediaType": "video"
}
}
The following table describes the parameters in the preceding message body.
Parameter | Type | Required | Description | |
EventType | String | Yes | The event type. | |
UserId | Long | Yes | The user ID. | |
EventTime | String | Yes | The time when the event was generated. The time follows the ISO 8601 standard in the | |
MessageBody | - | Object | - | The message body. |
MediaId | String | Yes | The ID of the media asset. | |
MediaType | String | Yes | The type of the media asset. Valid values:
| |
FileUrl | String | Yes | The file URL. | |
Size | String | Yes | The file size. | |
AppId | String | Yes | The application ID. | |
UserData | String | No | The user-defined data. | |
Status | String | Yes | The upload status. |
UploadByURLComplete: An audio or video file is uploaded by using the URL of the file
Sample message body:
{
"EventType": "UploadByURLComplete",
"UserId": 183322097756****,
"EventTime": "2022-07-15T08:48:14Z",
"MessageBody": {
"Status": "Success",
"SourceURL": "http://***/big_buck_bunny.mp4",
"MediaId": "c321b3a0041a71eda1590674a2ce****",
"AppId": "app-1000000",
"MediaType": "video",
"JobId": "88aabd2461ec4ad389f439f6ff92****"
}
}
The following table describes the parameters in the preceding message body.
Parameter | Type | Required | Description | |
EventType | String | Yes | The event type. | |
UserId | Long | Yes | The user ID. | |
EventTime | String | Yes | The time when the event was generated. The time follows the ISO 8601 standard in the | |
MessageBody | - | Object | - | The message body. |
MediaId | String | Yes | The ID of the media asset. | |
MediaType | String | Yes | The type of the media asset. Valid values:
| |
SourceURL | String | Yes | The URL of the source file. | |
JobId | String | Yes | The task ID. | |
AppId | String | Yes | The application ID. | |
UserData | String | No | The user-defined data. | |
Status | String | Yes | The upload status. |
ImageUploadComplete: An image is uploaded
Sample message body:
{
"EventType": "ImageUploadComplete",
"UserId": 183322097756****,
"EventTime": "2022-07-06T08:27:52Z",
"MessageBody": {
"Status": "Success",
"FileUrl": "https://outin-***.oss-cn-shanghai.aliyuncs.com/image/default/E81B931FA75246B3972844D35291****-6-2.jpg",
"MediaId": "7e976e80fd0571ec82115523919d****",
"AppId": "app-1000000",
"Size": "132066",
"MediaType": "image"
}
}
The following table describes the parameters in the preceding message body.
Parameter | Type | Required | Description | |
EventType | String | Yes | The event type. | |
UserId | Long | Yes | The user ID. | |
EventTime | String | Yes | The time when the event was generated. The time follows the ISO 8601 standard in the | |
MessageBody | - | Object | - | The message body. |
MediaId | String | Yes | The ID of the media asset. | |
MediaType | String | Yes | The type of the media asset. The value is image. | |
FileUrl | String | Yes | The file URL. | |
Size | String | Yes | The file size. | |
AppId | String | Yes | The application ID. | |
UserData | String | No | The user-defined data. | |
Status | String | Yes | The upload status. |
AttachedMediaUploadComplete: An auxiliary media asset is uploaded
Sample message body:
{
"EventType": "AttachedMediaUploadComplete",
"UserId": 183322097756****,
"EventTime": "2022-07-15T06:38:33Z",
"MessageBody": {
"Status": "Success",
"FileUrl": "https://outin-***.oss-cn-shanghai.aliyuncs.com/subtitle/4C3C3021EC704639A9F2F55BB0C9****-3-3.ass",
"MediaId": "b3e59350040871ed9d535532918c****",
"AppId": "app-1000000",
"Size": "34758",
"MediaType": "text"
}
}
The following table describes the parameters in the preceding message body.
Parameter | Type | Required | Description | |
EventType | String | Yes | The event type. | |
UserId | Long | Yes | The user ID. | |
EventTime | String | Yes | The time when the event was generated. The time follows the ISO 8601 standard in the | |
MessageBody | - | Object | Yes | The message body. |
MediaId | String | Yes | The ID of the media asset. | |
MediaType | String | Yes | The type of the media asset. The value is text. | |
FileUrl | String | Yes | The file URL. | |
Size | String | Yes | The file size. | |
AppId | String | Yes | The application ID. | |
UserData | String | No | The user-defined data. | |
Status | String | Yes | The upload status. |
RegisterStreamComplete: A media stream is registered
Sample message body:
{
"EventType": "RegisterStreamComplete",
"UserId": 127753575120****,
"EventTime": "2022-07-13T09:34:39Z",
"MessageBody": {
"Status": "Success",
"FileUrl": "https://***.oss-cn-shenzhen.aliyuncs.com/%E6%8E%A5%E5%8F%A3%E6%B5%8B%E8%AF%95/900d1-b****.aac",
"MediaId": "fa04bee0028e71edb10f81848c01****",
"UserData": "{\"MessageCallback\":{\"CallbackURL\":\"***\",\"CallbackType\":\"http\"}}"
}
}
The following table describes the parameters in the preceding message body.
Parameter | Type | Required | Description | |
EventType | String | Yes | The event type. | |
UserId | Long | Yes | The user ID. | |
EventTime | String | Yes | The time when the event was generated. The time follows the ISO 8601 standard in the | |
MessageBody | - | Object | Yes | The message body. |
MediaId | String | Yes | The ID of the media asset. | |
FileUrl | String | Yes | The file URL. | |
UserData | String | No | The user-defined data. | |
Status | String | Yes | The registration status. |
StreamUploadComplete: A media stream is uploaded
Sample message body:
{
"EventType": "StreamUploadComplete",
"UserId": 174809843091****,
"EventTime": "2022-07-05T12:53:30Z",
"MessageBody": {
"Status": "Success",
"FileUrl": "http://***.aliyuncs.com/vod-f1e0dd/stream/b37ff450fc6071ec9c5e472190a9****/a0c69a523724cc432c897dcaa6f3****-fd.mp4",
"MediaId": "b37ff450fc6071ec9c5e472190a9****",
"UserData": "{\"MessageCallback\":\"{\\\"CallbackURL\\\":\\\"***\\\",\\\"CallbackType\\\":\\\"http\\\"}\"}"
}
}
The following table describes the parameters in the preceding message body.
Parameter | Type | Required | Description | |
EventType | String | Yes | The event type. | |
UserId | Long | Yes | The user ID. | |
EventTime | String | Yes | The time when the event was generated. The time follows the ISO 8601 standard in the | |
MessageBody | - | Object | Yes | The message body. |
MediaId | String | Yes | The ID of the media asset. | |
FileUrl | String | Yes | The file URL. | |
UserData | String | No | The user-defined data. | |
Status | String | Yes | The upload status. |
UploadStreamByURLComplete: A media stream is uploaded by using the URL of the media stream
Sample message body:
{
"EventType": "UploadStreamByURLComplete",
"UserId": 174809843091****,
"EventTime": "2022-07-07T08:09:14Z",
"MessageBody": {
"Status": "Success",
"SourceURL": "http://***/example/html5/mov_bbb.mp4",
"MediaId": "0f65faa0fdcc71ecbfcd472190a9****",
"UserData": "{\"MessageCallback\":\"{\\\"CallbackURL\\\":\\\"***\\\",\\\"CallbackType\\\":\\\"http\\\"}\"}",
"JobId": "7f0d49297cb0fa50ab7341fd60f4****"
}
}
The following table describes the parameters in the preceding message body.
Parameter | Type | Required | Description | |
EventType | String | Yes | The event type. | |
UserId | Long | Yes | The user ID. | |
EventTime | String | Yes | The time when the event was generated. The time follows the ISO 8601 standard in the | |
MessageBody | - | Object | Yes | The message body. |
MediaId | String | Yes | The ID of the media asset. | |
SourceURL | String | Yes | The URL of the source file. | |
JobId | String | Yes | The task ID. | |
UserData | String | No | The user-defined data. | |
Status | String | Yes | The upload status. |
CreateAuditComplete: A manual review task is complete
Sample message body:
{
"EventType": "CreateAuditComplete",
"UserId": 183320223010****,
"EventTime": "2022-06-23T13:11:33Z",
"MessageBody": {
"Status": "Success",
"Auditor": "auditor",
"Comment": "test",
"AuditStatus": "Normal",
"MediaId": "71151b80f2d471ecb21b472190a9****",
"CreationTime": "2022-06-23T13:11:33Z",
"Reason": "test"
}
}
The following table describes the parameters in the preceding message body.
Parameter | Type | Required | Description | |
EventType | String | Yes | The event type. | |
UserId | Long | Yes | The user ID. | |
EventTime | String | Yes | The time when the event was generated. The time follows the ISO 8601 standard in the | |
MessageBody | - | Object | Yes | The message body. |
MediaId | String | Yes | The ID of the media asset. | |
AuditStatus | String | Yes | The review state. Valid values:
| |
Auditor | String | Yes | The reviewer. | |
Reason | String | Yes | The reason of the review result. | |
Comment | String | Yes | The comments. | |
CreationTime | String | Yes | The time when the review task was created. | |
Status | String | Yes | The state of the manual review task. Valid values:
|
RegisterMediaComplete: A media asset is registered
Event description:
You can call the RegisterMediaInfo operation to register a media asset with the content library. After the media asset is analyzed, a callback is triggered.
Sample message body:
{
"EventType": "RegisterMediaComplete",
"UserId": 183320223010****,
"EventTime": "2022-06-23T13:11:33Z",
"MessageBody": {
"Status": "Success",
"MediaId": "71151b80f2d471ecb21b472190a9****"
}
}
The following table describes the parameters in the preceding message body.
Parameter | Type | Required | Description | |
EventType | String | Yes | The event type. | |
UserId | Long | Yes | The user ID. | |
EventTime | String | Yes | The time when the event was generated. The time follows the ISO 8601 standard in the | |
MessageBody | - | Object | Yes | The message body. |
MediaId | String | Yes | The ID of the media asset. | |
Status | String | Yes | Indicates whether the media asset is registered. Valid values:
| |
UserData | String | No | The user-defined data. | |
ErrorCode | String | No | The error code. | |
ErrorMessage | String | No | The error message. |
DeleteMediaComplete: A media asset is deleted
Event description:
This callback is triggered when one of the following API operations is called:
Sample message body:
{
"EventType": "DeleteMediaComplete",
"UserId": 183320223010****,
"EventTime": "2022-06-23T13:11:33Z",
"MessageBody": {
"Status": "Success",
"MediaId": "71151b80f2d471ecb21b472190a9****",
"DeleteType": "all"
}
}
The following table describes the parameters in the preceding message body.
Parameter | Type | Required | Description | |
EventType | String | Yes | The event type. | |
UserId | Long | Yes | The user ID. | |
EventTime | String | Yes | The time when the event was generated. The time follows the ISO 8601 standard in the | |
MessageBody | - | Object | Yes | The message body. |
MediaId | String | Yes | The ID of the media asset. | |
Status | String | Yes | Indicates whether the media asset is deleted. Valid values:
| |
DeleteType | String | Yes | The type of the resource to be deleted. Valid values:
| |
FileURLs | String | No | This parameter is available only if the value of the DeleteType parameter is stream. | |
ErrorCode | String | No | The error code. | |
ErrorMessage | String | No | The error message. |
MediaBaseChangeComplete: The basic information about a media asset is modified
Event description:
This callback is triggered when one of the following API operations is called:
Sample message body:
{
"EventType": "MediaBaseChangeComplete",
"UserId": 183320223010****,
"EventTime": "2022-06-23T13:11:33Z",
"MessageBody": {
"Status":"Success",
"MediaId":"3b46b391419aj294m83b459f7435****",
"MediaType":"video",
"OperateMode":"update",
"MediaContent":"{\"CoverURL\":\"{\\\"OldValue\\\":\\\"https://outin-8e7b1c7d2a3811eb83da00163e00****.oss-cn-shanghai.aliyuncs.com/0202342e8ae944d09695fd7dbc6d69dc/snapshots/4a6c26eb46a841a3b60c1d56acce****-00005.jpg\\\",\\\"NewValue\\\":\\\"http://cdn.com/ee.png\\\"}\"}"
}
}
The following table describes the parameters in the preceding message body.
Parameter | Type | Required | Description | ||
EventType | String | Yes | The event type. | ||
UserId | Long | Yes | The user ID. | ||
EventTime | String | Yes | The time when the event was generated. The time follows the ISO 8601 standard in the | ||
MessageBody | - | Object | Yes | The message body. | |
Status | String | Yes | Indicates whether the basic information about the media asset is modified. Valid values:
| ||
MediaType | String | Yes | The type of the media asset. Valid values:
| ||
MediaId | String | Yes | The ID of the media asset. | ||
OperateMode | String | Yes | The operation mode. Valid values:
| ||
MediaContent | - | Object | Yes | The modified content of the media asset, which is in the JSON format. The basic information about audio and video files can be modified. | |
Title | String | No | The title. The value is a JSON string. Example: | ||
Description | String | No | The description. The value is a JSON string. Example: | ||
CoverURL | String | No | The URL of the thumbnail image. The value is a JSON string. Example: | ||
CateId | String | No | The category ID. The value is a JSON string. Example: | ||
Tags | String | No | The tags. The value is a JSON string. Example: |