Intelligent Media Services (IMS) provides callback events for media asset uploads, media processing, and cloud editing. You can configure specific callback events to receive timely updates on task progress and status. The following sections provide sample message bodies for each event type along with field descriptions.
Usage
For an HTTP(S) request, the message body is the request body. For an MNS queue, it is the content of the received message.
Event list
Table 1. Media asset upload
|
Event |
Description |
|
An audio or video file is uploaded. |
|
|
A file is uploaded from a URL. |
|
|
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 from a URL. |
Table 2. Media asset management
|
Event |
Description |
|
A manual review is complete. |
|
|
A media asset is registered. |
|
|
A media asset is deleted. |
|
|
A media asset's basic information is updated. |
Event
FileUploadComplete
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"
}
}
Message body parameters:
|
Parameter |
Type |
Required |
Description |
|
|
EventType |
String |
Yes |
The event type. |
|
|
UserId |
Long |
Yes |
The user ID. |
|
|
EventTime |
String |
Yes |
Event time (UTC time), in the format |
|
|
MessageBody |
- |
Object |
- |
The message body. |
|
MediaId |
String |
Yes |
The media asset ID. |
|
|
MediaType |
String |
Yes |
The media asset type. 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 event status. Valid values: |
|
UploadByURLComplete
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 for the message body.
|
Parameter |
Type |
Required |
Description |
|
|
EventType |
String |
Yes |
The event type. |
|
|
UserId |
Long |
Yes |
The user ID. |
|
|
EventTime |
String |
Yes |
The time the event occurred, in UTC. The format is |
|
|
MessageBody |
- |
Object |
- |
The message body. |
|
MediaId |
String |
Yes |
The media asset ID. |
|
|
MediaType |
String |
Yes |
The media asset type. Valid values:
|
|
|
SourceURL |
String |
Yes |
The source file URL. |
|
|
JobId |
String |
Yes |
The task ID. |
|
|
AppId |
String |
Yes |
The application ID. |
|
|
UserData |
String |
No |
The user-defined data. |
|
|
Status |
String |
Yes |
The task status. Valid values: |
|
ImageUploadComplete
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 message body contains the following parameters:
|
Parameter |
Type |
Required |
Description |
|
|
EventType |
String |
Yes |
The event type. |
|
|
UserId |
Long |
Yes |
The user ID. |
|
|
EventTime |
String |
Yes |
The time when the event occurred, in UTC. The format is |
|
|
MessageBody |
- |
Object |
- |
The message body. |
|
MediaId |
String |
Yes |
The media asset ID. |
|
|
MediaType |
String |
Yes |
The media asset type. Valid value: |
|
|
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 status. Valid values: |
|
AttachedMediaUploadComplete
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 message body contains the following parameters.
|
Parameter |
Type |
Required |
Description |
|
|
EventType |
String |
Yes |
The event type. |
|
|
UserId |
Long |
Yes |
The user ID. |
|
|
EventTime |
String |
Yes |
The time at which the event occurred, in UTC. The format is |
|
|
MessageBody |
- |
Object |
Yes |
The message body. |
|
MediaId |
String |
Yes |
The media asset ID. |
|
|
MediaType |
String |
Yes |
The media asset type. Valid value: |
|
|
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. Valid values: |
|
RegisterStreamComplete
Sample message body:
{
"EventType": "RegisterStreamComplete",
"UserId": 127753575120****,
"EventTime": "2022-07-13T09:34:39Z",
"MessageBody": {
"Status": "Success",
"FileUrl": "https://***.oss-cn-shenzhen.aliyuncs.com/InterfaceTest/900d1-b****.aac",
"MediaId": "fa04bee0028e71edb10f81848c01****",
"UserData": "{\"MessageCallback\":{\"CallbackURL\":\"***\",\"CallbackType\":\"http\"}}"
}
}
The following table lists the parameters of the message body.
|
Parameter |
Type |
Required |
Description |
|
|
EventType |
String |
Yes |
The event type. |
|
|
UserId |
Long |
Yes |
The user ID. |
|
|
EventTime |
String |
Yes |
The time the event occurred, in UTC. The time is in the |
|
|
MessageBody |
- |
Object |
Yes |
The message body. |
|
MediaId |
String |
Yes |
The media ID. |
|
|
FileUrl |
String |
Yes |
The file URL. |
|
|
UserData |
String |
No |
Optional user-defined data. |
|
|
Status |
String |
Yes |
The status. Valid values are |
|
StreamUploadComplete
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\\\"}\"}"
}
}
Message body fields:
|
Parameter |
Type |
Required |
Description |
|
|
EventType |
String |
Yes |
The event type. |
|
|
UserId |
Long |
Yes |
The user ID. |
|
|
EventTime |
String |
Yes |
The event time in UTC. The format is |
|
|
MessageBody |
- |
Object |
Yes |
The message body. |
|
MediaId |
String |
Yes |
The media asset ID. |
|
|
FileUrl |
String |
Yes |
The file URL. |
|
|
UserData |
String |
No |
The user-defined data. |
|
|
Status |
String |
Yes |
The status. Valid values: |
|
UploadStreamByURLComplete: Media stream URL upload complete
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****"
}
}
This table lists the message body parameters.
|
Parameter |
Type |
Required |
Description |
|
|
EventType |
String |
Yes |
The event type. |
|
|
UserId |
Long |
Yes |
The user ID. |
|
|
EventTime |
String |
Yes |
The time the event occurred, in UTC. The format is |
|
|
MessageBody |
- |
Object |
Yes |
The message body. |
|
MediaId |
String |
Yes |
The media asset ID. |
|
|
SourceURL |
String |
Yes |
The source file URL. |
|
|
JobId |
String |
Yes |
The job ID. |
|
|
UserData |
String |
No |
The user data. |
|
|
Status |
String |
Yes |
The job status. Valid values: Success or Fail. |
|
CreateAuditComplete: Manual review 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 message body contains the following parameters:
|
Parameter |
Type |
Required |
Description |
|
|
EventType |
String |
Yes |
The event type. |
|
|
UserId |
Long |
Yes |
The user ID. |
|
|
EventTime |
String |
Yes |
The time the event occurred, in UTC. The format is |
|
|
MessageBody |
- |
Object |
Yes |
The message body. |
|
MediaId |
String |
Yes |
The media asset ID. |
|
|
AuditStatus |
String |
Yes |
The review status. Valid values:
|
|
|
Auditor |
String |
Yes |
The reviewer who performed the manual review. |
|
|
Reason |
String |
Yes |
The reason for the review result. |
|
|
Comment |
String |
Yes |
The reviewer's comment. |
|
|
CreationTime |
String |
Yes |
The creation time of the manual review task. |
|
|
Status |
String |
Yes |
The state of the manual review task. Valid values:
|
|
RegisterMediaComplete
Event description:
To register a media asset with the content library, call RegisterMediaInfo. A callback is triggered once the media asset analysis is complete.
Sample message body:
{
"EventType": "RegisterMediaComplete",
"UserId": 183320223010****,
"EventTime": "2022-06-23T13:11:33Z",
"MessageBody": {
"Status": "Success",
"MediaId": "71151b80f2d471ecb21b472190a9****"
}
}
The message body includes the following parameters:
|
Parameter |
Type |
Required |
Description |
|
|
EventType |
String |
Yes |
The type of event. |
|
|
UserId |
Long |
Yes |
The ID of the user. |
|
|
EventTime |
String |
Yes |
The event time in UTC, in ISO 8601 format: |
|
|
MessageBody |
- |
Object |
Yes |
The body of the message. |
|
MediaId |
String |
Yes |
The ID of the media asset. |
|
|
Status |
String |
Yes |
The status of the registration task. Valid values include:
|
|
|
UserData |
String |
No |
User-defined data. |
|
|
ErrorCode |
String |
No |
The error code returned if the task fails. |
|
|
ErrorMessage |
String |
No |
The error message returned if the task fails. |
|
DeleteMediaComplete
Event
This callback is triggered when you call one of the following OpenAPI operations:
Sample message body:
{
"EventType": "DeleteMediaComplete",
"UserId": 183320223010****,
"EventTime": "2022-06-23T13:11:33Z",
"MessageBody": {
"Status": "Success",
"MediaId": "71151b80f2d471ecb21b472190a9****",
"DeleteType": "all"
}
}
The message body contains the following parameters.
|
Parameter |
Type |
Required |
Description |
|
|
EventType |
String |
Yes |
The event type. |
|
|
UserId |
Long |
Yes |
The user ID. |
|
|
EventTime |
String |
Yes |
The time in UTC when the event occurred, in |
|
|
MessageBody |
- |
Object |
Yes |
The message body. |
|
MediaId |
String |
Yes |
The ID of the media asset. |
|
|
Status |
String |
Yes |
The status of the media asset deletion task. Valid values:
|
|
|
DeleteType |
String |
Yes |
The type of resource to delete. Valid values:
|
|
|
FileURLs |
String |
No |
This parameter is present only if |
|
|
ErrorCode |
String |
No |
The error code. |
|
|
ErrorMessage |
String |
No |
The error message. |
|
MediaBaseChangeComplete: Basic media information updated
Event description:
Calling one of the following OpenAPI operations triggers this callback:
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 message body contains the following parameters:
|
Parameter |
Type |
Required |
Description |
||
|
EventType |
String |
Yes |
The event type. |
||
|
UserId |
Long |
Yes |
The user ID. |
||
|
EventTime |
String |
Yes |
The time when the event occurred, in UTC. The format must be |
||
|
MessageBody |
- |
Object |
Yes |
The message body. |
|
|
Status |
String |
Yes |
The status of the media asset update task. Valid values:
|
||
|
MediaType |
String |
Yes |
The media type. Valid values:
|
||
|
MediaId |
String |
Yes |
The media ID. |
||
|
OperateMode |
String |
Yes |
The operation mode. Valid values:
|
||
|
MediaContent |
- |
Object |
Yes |
The content of the media asset modification. This object contains basic information for audio and video files. |
|
|
Title |
String |
No |
The title, formatted as a JSON string. Example: |
||
|
Description |
String |
No |
The description, formatted as a JSON string. Example: |
||
|
CoverURL |
String |
No |
The URL of the thumbnail image, formatted as a JSON string. Example: |
||
|
CateId |
String |
No |
The category ID, formatted as a JSON string. Example: |
||
|
Tags |
String |
No |
The tags, formatted as a JSON string. Example: |
||