Table of Contents

Class InboundSms

Namespace
Vonage.Messaging
Assembly
Vonage.dll

Represents an inbound SMS message received via webhook from the Vonage SMS API. Configure your webhook URL in the Vonage Dashboard to receive these messages.

public class InboundSms : ISignable
Inheritance
InboundSms
Implements
Inherited Members

Properties

ApiKey

The Vonage API key that received this message.

[JsonProperty("api-key")]
[JsonPropertyName("api-key")]
public string ApiKey { get; set; }

Property Value

string

Concat

Indicates whether this message is part of a concatenated (multi-part) SMS.

[JsonProperty("concat")]
[JsonPropertyName("concat")]
[JsonConverter(typeof(StringBoolConverter))]
[JsonConverter(typeof(StringToBoolConverter))]
public bool Concat { get; set; }

Property Value

bool

ConcatPart

The part number of this message within a concatenated SMS (1-indexed).

[JsonProperty("concat-part")]
[JsonPropertyName("concat-part")]
public string ConcatPart { get; set; }

Property Value

string

ConcatRef

The reference identifier linking all parts of a concatenated SMS.

[JsonProperty("concat-ref")]
[JsonPropertyName("concat-ref")]
public string ConcatRef { get; set; }

Property Value

string

ConcatTotal

The total number of parts in a concatenated SMS.

[JsonProperty("concat-total")]
[JsonPropertyName("concat-total")]
public string ConcatTotal { get; set; }

Property Value

string

Data

The content of the message for binary messages (hex-encoded).

[JsonProperty("data")]
[JsonPropertyName("data")]
public string Data { get; set; }

Property Value

string

Keyword

The first word of the message text, typically used for keyword-based routing.

[JsonProperty("keyword")]
[JsonPropertyName("keyword")]
public string Keyword { get; set; }

Property Value

string

MessageId

The unique identifier for this message.

[JsonProperty("messageId")]
[JsonPropertyName("messageId")]
public string MessageId { get; set; }

Property Value

string

MessageTimestamp

The timestamp when the message was received, in format: yyyy-MM-dd HH:mm:ss.

[JsonProperty("message-timestamp")]
[JsonPropertyName("message-timestamp")]
public string MessageTimestamp { get; set; }

Property Value

string

Msisdn

The phone number of the sender in E.164 format.

[JsonProperty("msisdn")]
[JsonPropertyName("msisdn")]
public string Msisdn { get; set; }

Property Value

string

Nonce

A random string used for signature validation. Only present if signatures are enabled.

[JsonProperty("nonce")]
[JsonPropertyName("nonce")]
public string Nonce { get; set; }

Property Value

string

Sig

The signature to enable verification of the source of this webhook. Please see the developer documentation for validating signatures for more information, or use one of our published SDKs. Only included if you have signatures enabled

[JsonProperty("sig")]
[JsonPropertyName("sig")]
public string Sig { get; set; }

Property Value

string

Text

The text content of the message.

[JsonProperty("text")]
[JsonPropertyName("text")]
public string Text { get; set; }

Property Value

string

Timestamp

A Unix timestamp used for signature validation. Only present if signatures are enabled.

[JsonProperty("timestamp")]
[JsonPropertyName("timestamp")]
public string Timestamp { get; set; }

Property Value

string

To

The Vonage virtual number that received the message.

[JsonProperty("to")]
[JsonPropertyName("to")]
public string To { get; set; }

Property Value

string

Type

The message type: text, unicode, or binary.

[JsonProperty("type")]
[JsonPropertyName("type")]
public string Type { get; set; }

Property Value

string

Udh

The User Data Header for binary messages (hex-encoded).

[JsonProperty("udh")]
[JsonPropertyName("udh")]
public string Udh { get; set; }

Property Value

string

Methods

ValidateSignature(string, Method)

Validate the webhook signature against a secret.

public bool ValidateSignature(string signatureSecret, SmsSignatureGenerator.Method method)

Parameters

signatureSecret string

The secret.

method SmsSignatureGenerator.Method

The encryption method.

Returns

bool

Whether the signature has been validated or not.