Class Messages
- Namespace
- Vonage.Applications.Capabilities
- Assembly
- Vonage.dll
Represents the Messages capability for an application. Configures webhooks for inbound messages and message status updates.
public class Messages : Capability
- Inheritance
-
Messages
- Inherited Members
Constructors
Messages()
Initializes a new instance of the Messages class.
public Messages()
Messages(IDictionary<Type, Webhook>)
Initializes a new instance of the Messages class with the specified webhooks.
public Messages(IDictionary<Webhook.Type, Webhook> webhooks)
Parameters
webhooksIDictionary<Webhook.Type, Webhook>The webhook configuration dictionary.
Methods
Build()
Creates a new Messages capability builder for fluent configuration.
public static Messages Build()
Returns
- Messages
A new Messages capability instance.
Examples
var messagesCapability = Messages.Build()
.WithInboundUrl("https://example.com/webhooks/inbound")
.WithStatusUrl("https://example.com/webhooks/status");
WithInboundUrl(string)
Sets the inbound URL webhook. Vonage will forward inbound messages to this URL.
public Messages WithInboundUrl(string url)
Parameters
urlstringThe webhook URL that will receive inbound messages.
Returns
- Messages
The Messages capability instance for fluent chaining.
Examples
var messages = Messages.Build()
.WithInboundUrl("https://example.com/webhooks/inbound");
WithStatusUrl(string)
Sets the status URL webhook. Vonage will send message status updates (e.g. delivered, seen) to this URL.
public Messages WithStatusUrl(string url)
Parameters
urlstringThe webhook URL that will receive message status updates.
Returns
- Messages
The Messages capability instance for fluent chaining.
Examples
var messages = Messages.Build()
.WithStatusUrl("https://example.com/webhooks/status");