Table of Contents

Struct WhatsAppWorkflow

Namespace
Vonage.VerifyV2.StartVerification.WhatsApp
Assembly
Vonage.dll

Represents a verification workflow that delivers the PIN code via WhatsApp message. Requires a WhatsApp Business Account (WABA) connected sender number.

public readonly struct WhatsAppWorkflow : 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

From

The WABA (WhatsApp Business Account) connected sender number in E.164 format without leading + or 00 (e.g., "447700400080").

[JsonPropertyOrder(2)]
[JsonConverter(typeof(PhoneNumberJsonConverter))]
public PhoneNumber From { get; }

Property Value

PhoneNumber

Mode

Defines the WhatsApp verification experience. Use zero_tap for automatic verification on Android apps. Defaults to otp_code.

[JsonPropertyOrder(3)]
[JsonConverter(typeof(EnumDescriptionJsonConverter<WhatsAppWorkflow.WhatsAppMode>))]
public WhatsAppWorkflow.WhatsAppMode Mode { get; }

Property Value

WhatsAppWorkflow.WhatsAppMode

To

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

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

Property Value

PhoneNumber

Methods

Parse(string, string)

Creates a new WhatsApp verification workflow with OTP Code.

public static Result<WhatsAppWorkflow> Parse(string to, string from)

Parameters

to string

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

from string

The WABA connected sender number in E.164 format without leading + or 00 (e.g., "447700400080").

Returns

Result<WhatsAppWorkflow>

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

Examples

var workflow = WhatsAppWorkflow.Parse("447700900000", "447700400080");
See Also

ParseWithZeroTap(string, string)

Creates a new WhatsApp verification workflow with zero_tap for automatic verification on android apps.

public static Result<WhatsAppWorkflow> ParseWithZeroTap(string to, string from)

Parameters

to string

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

from string

The WABA connected sender number in E.164 format without leading + or 00 (e.g., "447700400080").

Returns

Result<WhatsAppWorkflow>

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

Examples

var workflow = WhatsAppWorkflow.ParseWithZeroTap("447700900000", "447700400080");
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.