Publishes one or more events.

URI

/openapi/putEvents

Limits

  • The maximum size of an event that can be published is 64 KB. This complies with the requirement specified in the CloudEvents specification.
  • The maximum number of events that can be published in a request is 16.
  • The maximum total size of events that can be published in a request is 256 KB, which is equivalent to 262,144 bytes.

Request parameters

ParameterTypeRequiredExampleDescription
datacontenttypeStringNoapplication/jsonThe content type of the data parameter. Set the value of this parameter to application/json.
dataStructNotestThe content of the event.
subjectStringNoacs:oss:cn-hangzhou:123456789098****:xls-papk/game_apk/123.jpgThe subject of the event.
specversionStringYes1.0The version of the CloudEvents specification.
aliyuneventbusnameStringYesmybusThe name of the event bus that receives the event.
idStringYesa5074581-7e74-4e4c-868f-47e7afdf****The ID of the event.
sourceStringYesacs.ossThe event source.
timeTimestampYes2020-08-24T13:54:05.965Asia/ShanghaiThe time when the event occurred.
typeStringYesoss:ActionTrail:ApiCallThe type of the event.
Note For more information about the limits on the parameters, see Limits.

Response parameters

ParameterTypeExampleDescription
RequestIdString5E9AB1DF333245F1D800****The ID of the request. This parameter is a common parameter. Each request has a unique ID.
FailedEntryCountInt0The number of events that failed to be processed.
EntryListListThe information about the event body.
EventIdString99418e3a-2025-41c6-a914-b8d6568e****The ID of the event.
TraceIdString445EFED2EC2A7FC17FB05AF4AD01****The ID of the trace. This parameter is used for troubleshooting.

Examples

Sample requests

POST /openapi/putEvents HTTP/1.1
Host: 123456789098****.eventbridge.cn-hangzhou.aliyuncs.com
Date: Sat, 18 Apr 2020 05:30:41 GMT
x-eventbridge-version: 2020-04-01
Authorization: acs vZ3VL0SuJdHi****:Jo2PbTjR******YAYoYslKLvWzg=
Content-Type: application/cloudevents-batch+json;charset=UTF-8
Content-Length: 418

[
    {
        "datacontenttype":"application/json",
        "data":"test",
        "subject":"acs:oss:cn-hangzhou:123456789098****:xls-papk/game_apk/123.jpg",
        "specversion":"1.0",
        "aliyuneventbusname":"mybus",
        "id":"a5074581-7e74-4e4c-868f-47e7afdf****",
        "source":"acs.oss",
        "time":"2020-08-24T13:54:05.965Asia/Shanghai",
        "type":"oss:ActionTrail:ApiCall"
    }
]

Sample responses

HTTP/1.1 200 OK
Server: AliyunEventBridge
Connection: keep-alive
Content-Type: application/json;charset=utf-8
Content-Length: 171
x-eventbridge-request-id: 5E9AB1DF333245F1D800****
Date: Sat, 18 Apr 2020 05:30:41 GMT

{
    "RequestId":"5E9AB1DF333245F1D800****",
    "FailedEntryCount":0,
    "EntryList":[
        {
            "EventId":"99418e3a-2025-41c6-a914-b8d6568e****",
            "TraceId":"445EFED2EC2A7FC17FB05AF4AD01****"
        }
    ]
}