Table of Contents

Struct SmsWorkflow

Namespace
Vonage.VerifyV2.StartVerification.Sms
Assembly
Vonage.dll

Represents a verification workflow that delivers the PIN code via SMS text message. Supports optional Android app hash for auto-detection and entity_id/content_id for Indian carrier compliance.

public readonly struct SmsWorkflow : IVerificationWorkflow
Implements
Inherited Members

Properties

Channel

The verification channel identifier (e.g., "sms", "voice", "email", "whatsapp", "whatsapp_interactive", "silent_auth").

[JsonPropertyOrder(0)]
public string Channel { get; }

Property Value

string

ContentId

Optional value corresponding to a TemplateID for SMS delivery using Indian Carriers

[JsonPropertyOrder(4)]
[JsonPropertyName("content_id")]
[JsonConverter(typeof(MaybeJsonConverter<string>))]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public Maybe<string> ContentId { get; }

Property Value

Maybe<string>

EntityId

Optional PEID required for SMS delivery using Indian Carriers

[JsonPropertyOrder(3)]
[JsonPropertyName("entity_id")]
[JsonConverter(typeof(MaybeJsonConverter<string>))]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public Maybe<string> EntityId { get; }

Property Value

Maybe<string>

From

An optional sender number, in the E.164 format. Don't use a leading + or 00 when entering a phone number, start with the country code, for example, 447700900000. If no from number is given, the request will default to the brand.

[JsonPropertyOrder(5)]
[JsonPropertyName("from")]
[JsonConverter(typeof(MaybeJsonConverter<PhoneNumber>))]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public Maybe<PhoneNumber> From { get; }

Property Value

Maybe<PhoneNumber>

Hash

Optional Android Application Hash Key for automatic code detection on a user's device.

[JsonPropertyOrder(2)]
[JsonPropertyName("app_hash")]
[JsonConverter(typeof(MaybeJsonConverter<string>))]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public Maybe<string> Hash { get; }

Property Value

Maybe<string>

To

The phone number to contact, in the E.164 format. Don't use a leading + or 00 when entering a phone number, start with the country code, for example, 447700900000.

[JsonPropertyOrder(1)]
[JsonConverter(typeof(PhoneNumberJsonConverter))]
public PhoneNumber To { get; }

Property Value

PhoneNumber

Methods

Parse(string, string, string, string, string)

Creates a new SMS verification workflow.

public static Result<SmsWorkflow> Parse(string to, string hash = null, string entityId = null, string contentId = null, string from = null)

Parameters

to string

The recipient phone number in E.164 format without leading + or 00 (e.g., "447700900000").

hash string

Optional 11-character Android application hash key for SMS auto-detection using the SMS Retriever API.

entityId string

Optional Principal Entity ID (PEID) required for SMS delivery to Indian phone numbers (1-200 characters).

contentId string

Optional content template ID required for SMS delivery to Indian phone numbers (1-200 characters).

from string

Optional sender number in E.164 format (1-15 characters). If not provided, the brand name is used as the sender ID.

Returns

Result<SmsWorkflow>

A Result<T> containing the workflow if successful, or validation errors if the input is invalid.

Examples

// Basic SMS workflow
var workflow = SmsWorkflow.Parse("447700900000");

// SMS workflow with Android app hash for auto-detection
var workflow = SmsWorkflow.Parse("447700900000", hash: "ABC123def45");

// SMS workflow for Indian carriers
var workflow = SmsWorkflow.Parse("919876543210", entityId: "1101407360000017170", contentId: "1107158078772563946");
See Also

Serialize(IJsonSerializer)

Serializes the workflow configuration to JSON format for the API request.

public string Serialize(IJsonSerializer serializer)

Parameters

serializer IJsonSerializer

The JSON serializer to use.

Returns

string

The JSON representation of the workflow.