Sets the callback method, callback URL, and event type of an event notification.
Usage note
ApsaraVideo VOD supports the HTTP and MNS callback methods. For more information, see Event notification.
QPS limit
A single user can perform a maximum of 15 queries per second (QPS). Throttling is triggered when the number of calls per second exceeds the QPS limit. The throttling may affect your business. Thus, we recommend that you observe the QPS limit on this operation.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | SetMessageCallback |
The operation that you want to perform. Set the value to SetMessageCallback. |
CallbackURL | String | No | http://developer.aliyundoc.com |
The callback URL. This parameter only takes effect when the CallbackType parameter is set to HTTP. |
CallbackType | String | No | HTTP |
The callback method. Valid values:
|
EventTypeList | String | No | FileUploadComplete |
The type of the callback event. If you do not set this parameter, notifications for all types of events are disabled. If you set this parameter to ALL, notifications for all types of events are enabled. You can specify the event types for which notifications are enabled. Separate multiple event types with commas (,). For more information about the valid values of this parameter, see Event type. |
AuthSwitch | String | No | on |
Specifies whether to enable callback authentication. This parameter only takes effect when the CallbackType parameter is set to HTTP. Valid values:
|
AuthKey | String | No | dsf346dvet |
The cryptographic key. This parameter only takes effect when the CallbackType parameter is set to HTTP. The key can be up to 32 characters in length and must contain uppercase letters, lowercase letters, and digits. |
MnsEndpoint | String | No | http://****.mns.cn-shanghai.aliyuncs.com/ |
The public endpoint of Message Service (MNS). This parameter only takes effect when the CallbackType parameter is set to MNS. For more information, see Endpoint. |
MnsQueueName | String | No | quene_name |
The name of the MNS queue. This parameter only takes effect when the CallbackType parameter is set to MNS. |
AppId | String | No | app-1000000 |
The ID of the application. If you do not set this parameter, the default value app-1000000 is used. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 25818875-5F78-4AF6-D7393642CA58**** |
The ID of the request. |
Examples
Sample requests
http(s)://vod.cn-shanghai.aliyuncs.com/?Action=SetMessageCallback
&CallbackType=HTTP
&CallbackURL=http://developer.aliyundoc.com
&EventTypeList=FileUploadComplete
&AuthSwitch=on
&AuthKey=dsf346dvet
&MnsEndpoint=http://****.mns.cn-shanghai.aliyuncs.com/
&MnsQueueName=quene_name
&AppId=app-1000000
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<SetMessageCallbackResponse>
<RequestId>25818875-5F78-4AF6-D7393642CA58****</RequestId>
</SetMessageCallbackResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "25818875-5F78-4AF6-D7393642CA58****"
}
Error codes
For a list of error codes, visit the API Error Center.