- HTTP request
 - Path parameters
 - Request body
 - Response body
 - Authorization scopes
 - CloudEvent
 - CloudEventAttributeValue
 - Try it!
 
messageBuses.publish events to a message bus.
HTTP request
POST https://eventarcpublishing.googleapis.com/v1/{messageBus=projects/*/locations/*/messageBuses/*}:publish
The URL uses gRPC Transcoding syntax.
Path parameters
| Parameters | |
|---|---|
messageBus | 
                
                   
 Required. The full name of the message bus to publish events to. Format:   | 
              
Request body
The request body contains data with the following structure:
| JSON representation | 
|---|
{ // Union field  | 
                
| Fields | |
|---|---|
Union field  
  | 
                |
protoMessage | 
                  
                     
 The Protobuf format of the CloudEvent being published. Specification can be found here: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/protobuf-format.md  | 
                
jsonMessage | 
                  
                     
 The JSON format of the CloudEvent being published. Specification can be found here: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/json-format.md  | 
                
avroMessage | 
                  
                     
 The Avro format of the CloudEvent being published. Specification can be found here: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/avro-format.md A base64-encoded string.  | 
                
Response body
If successful, the response body is empty.
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.
CloudEvent
CloudEvent represents a vendor-neutral specification for defining the format of event data.
| JSON representation | 
|---|
{ "id": string, "source": string, "specVersion": string, "type": string, "attributes": { string: { object (  | 
              
| Fields | |
|---|---|
id | 
                
                   
 Required. Identifies the event. Producers MUST ensure that source + id is unique for each distinct event.  | 
              
source | 
                
                   
 Required. Identifies the context in which an event happened. URI-reference  | 
              
specVersion | 
                
                   
 Required. The version of the CloudEvents specification which the event uses.  | 
              
type | 
                
                   
 Required. This attribute contains a value describing the type of event related to the originating occurrence.  | 
              
attributes | 
                
                   
 Optional. Used for Optional & Extension Attributes An object containing a list of   | 
              
Union field data. The event payload. It should be encoded into a media format which is specified by the 'datacontenttype' attribute (e.g. application/json), and adheres to the dataschema format when those respective attributes are present. data can be only one of the following: | 
              |
binaryData | 
                
                   
 Optional. Binary data. A base64-encoded string.  | 
              
textData | 
                
                   
 Optional. Text data.  | 
              
protoData | 
                
                   
 Optional. Proto data. NOTE: The  An object containing fields of an arbitrary type. An additional field   | 
              
CloudEventAttributeValue
The following abstract data types are available for use in attributes.
| JSON representation | 
|---|
{ // Union field  | 
              
| Fields | |
|---|---|
Union field attr. The value of the attribute. attr can be only one of the following: | 
              |
ceBoolean | 
                
                   
 Boolean value.  | 
              
ceInteger | 
                
                   
 Integer value.  | 
              
ceString | 
                
                   
 String value.  | 
              
ceBytes | 
                
                   
 Bytes value. A base64-encoded string.  | 
              
ceUri | 
                
                   
 URI value.  | 
              
ceUriRef | 
                
                   
 URI-reference value.  | 
              
ceTimestamp | 
                
                   
 Timestamp value. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples:   |