EventEnvelope Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents the outer envelope for a Slack Events API callback, containing metadata and the inner event payload as received from Slack.
public class EventEnvelope : Microsoft.Agents.Extensions.Slack.Api.SlackModel
type EventEnvelope = class
inherit SlackModel
Public Class EventEnvelope
Inherits SlackModel
- Inheritance
Remarks
This class models the top-level structure of a Slack Events API request, including workspace, application, and authorization context, as well as the event-specific content. Use the strongly-typed properties for common envelope fields and the event_content property for the inner event payload. Additional or unmodeled fields are accessible via the AdditionalProperties dictionary. For more information on the envelope structure, see https://docs.slack.dev/apis/events-api/#callback-field.
Use Get<T>(String) and TryGet<T>(String, T) to access any field by dot-notation path. Top-level envelope fields (e.g. "team_id"), extension data fields, and nested event content fields using either the Slack JSON prefix "event." or the C# property prefix "event_content." are all supported.
var envelope = turnContext.Activity.GetChannelData<SlackChannelData>().EventEnvelope;
string workspaceId = envelope.Get<string>("team_id");
string channel = envelope.Get<string>("event.channel");
string itemType = envelope.Get<string>("event.item.type");
string blockType = envelope.Get<string>("event.blocks[0].type");
Constructors
| Name | Description |
|---|---|
| EventEnvelope() | |
Properties
| Name | Description |
|---|---|
| AdditionalProperties |
Catch-all for any envelope fields not explicitly modelled above. |
| api_app_id |
Unique identifier for the application this event is intended for. |
| authorizations |
Installation authorizations visible to this app for this event. Each element represents one installation in the scope of this event. |
| context_enterprise_id |
Enterprise org through which the app receives this event (may be null). |
| context_team_id |
The workspace through which the app receives this event. |
| event_content |
The inner event content. Use named properties for common fields, or navigate
any event-specific field with Get<T>(String).
Serialized as |
| event_context |
Identifier for this specific event; usable with the
|
| event_id |
Unique identifier for this event, globally unique across all workspaces. |
| event_time |
Epoch timestamp (seconds) indicating when this event was dispatched. |
| is_ext_shared_channel |
Whether the event occurred in an externally shared channel. |
| team_id |
Unique identifier for the workspace where this event occurred. |
| token |
Deprecated verification token. Slack recommends signed secrets instead. |
| type |
Callback type. Typically |
Methods
| Name | Description |
|---|---|
| Get<T>(String) |
Gets a value at the given dot-notation path. Supports dot-separated property
access and bracket array indexing (e.g. |
| GetData() |
Returns the JsonObject used for path navigation.
The default implementation lazily serializes this instance via
|
| NormalizePath(String) |
Normalizes a caller-supplied path before it is passed to the navigator. Override to remap C# property-name aliases to their JSON field names. The default implementation returns the path unchanged. |
| TryGet<T>(String, T) |
Tries to get a value at the given dot-notation path.
Returns |