Verification / OTP

TelegramGatewayNet

.NET SDK for the Telegram Gateway API

TelegramGatewayNet version on NuGetTelegramGatewayNet downloads on NuGetMITC#
netstandard2.0net8.0net10.0

Features

  • Send verification codes (OTP)
  • Check send ability (free of charge)
  • Check status and revoke a message
  • Webhook delivery-report signature validation
  • Unified GatewayResult<T> result type

Installation

bash
dotnet add package TelegramGatewayNet

Quick start

csharp
using TelegramGatewayNet;
using TelegramGatewayNet.Requests;

using var client = new TelegramGatewayClient("YOUR_GATEWAY_API_TOKEN");

var result = await client.SendVerificationMessageAsync(
    new SendVerificationMessageRequest("+391234567890")
    {
        CodeLength = 6,
        Ttl = 60,
        CallbackUrl = "https://my.webhook/auth",
    });

if (result.Ok)
    Console.WriteLine(result.Value.RequestId);
else
    Console.WriteLine($"Could not send: {result.Error}");

Key methods

SendVerificationMessageAsyncSend a code
CheckSendAbilityAsyncCheck deliverability
CheckVerificationStatusAsyncVerification status
RevokeVerificationMessageAsyncRevoke a message
READMEgithub.com/ai-iskuzhin/TelegramGatewayNet
Loading README from the repository…