Platform Event Fields
Migrate Platform Event Definitions with Metadata API
Get the Event Schema with REST API
Get the Event Schema with Pub/Sub API
Encrypting Platform Event Messages at Rest in the Event Bus
Previous Versions
Use Pub/Sub API to retrieve the event schema with the GetSchema RPC method and pass in a schema ID.
Because the schema typically doesn’t change often, we recommend that you call GetSchema once and use the returned schema for all operations. If the event schema changes, for example, when an administrator adds a field to the event definition, the schema ID changes. We recommend that you store the schema ID and compare it with the latest schema ID. If the schema ID changes, call GetSchema to retrieve the new schema.
1rpc GetSchema (SchemaRequest) returns (SchemaInfo);For more information, see GetSchema RPC Method in the Pub/Sub API Developer Guide.