net3000.twilio 1.0.0

dotnet add package net3000.twilio --version 1.0.0
                    
NuGet\Install-Package net3000.twilio -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="net3000.twilio" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="net3000.twilio" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="net3000.twilio" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add net3000.twilio --version 1.0.0
                    
#r "nuget: net3000.twilio, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package net3000.twilio@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=net3000.twilio&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=net3000.twilio&version=1.0.0
                    
Install as a Cake Tool

Net3000.Twilio

Overview

The Net3000.Twilio library provides comprehensive integration with the Twilio platform for Net3000 solutions. This library enables SMS messaging, phone verification, and communication services using Twilio's robust messaging and verification APIs.

Features

  • SMS Messaging: Send SMS messages with text and media content
  • Phone Verification: Send and verify phone number verification codes
  • Multi-Channel Support: Support for SMS, voice calls, email, WhatsApp, and SNA verification
  • Media Messages: Send SMS messages with image attachments
  • Verification Management: Complete phone verification workflow
  • Error Handling: Comprehensive error handling and response management

Installation

dotnet add package net3000.twilio

Dependencies

  • net3000.common (v9.0.11)
  • net3000.common.models (v1.0.7)
  • Twilio (v7.13.1)
  • Microsoft.Extensions.Configuration.Json (v9.0.9)

Configuration

Add your Twilio credentials to your configuration:

{
  "Twilio": {
    "account": "your-twilio-account-sid",
    "token": "your-twilio-auth-token",
    "from": "+1234567890",
    "serviceid": "your-verify-service-sid"
  }
}

Usage

Basic Setup

using net3000.TwilioApi;

// Initialize the service
var twilioService = new Lib(configuration);

Sending SMS Messages

// Send a simple SMS message
var result = twilioService.sendMessage(
    body: "Hello from Net3000!",
    to: "+1234567890"
);

// Send SMS with media attachment
var result = twilioService.sendMessage(
    body: "Check out this image!",
    to: "+1234567890",
    mediaUrl: "https://example.com/image.jpg"
);

Phone Verification

// Request verification code
var verificationResult = twilioService.requestPhoneVerificationCode(
    phone: "+1234567890",
    channel: VerificationChannel.sms
);

// Verify the code
var verificationCheck = twilioService.verifyPhone(
    phone: "+1234567890",
    code: "123456"
);

API Reference

Lib (Main Service Class)

Main service class for Twilio API integration.

Methods
  • sendMessage(string body, string to) - Send SMS message
  • sendMessage(string body, string to, string mediaUrl) - Send SMS with media
  • requestPhoneVerificationCode(string phone, VerificationChannel channel) - Request verification code
  • verifyPhone(string phone, string code) - Verify phone number with code

VerificationChannel Enum

  • sms - SMS verification
  • call - Voice call verification
  • email - Email verification
  • whatsapp - WhatsApp verification
  • sna - Silent Network Authentication

Response Handling

All methods return apiResponse objects with:

  • success - Boolean indicating success/failure
  • message - Response message
  • title - Response title
  • cssClass - CSS class for UI styling

Error Handling

The library provides comprehensive error handling with detailed error messages from the Twilio API. All methods include try-catch blocks and return standardized response objects.

Rate Limiting

The library respects Twilio API rate limits and includes proper error handling for rate limit exceeded responses.

Phone Number Format

  • Use E.164 format for phone numbers (e.g., +1234567890)
  • International numbers must include country code
  • Remove any spaces, dashes, or parentheses

Testing

Use Twilio's test environment for development:

  • Test Account SID and Auth Token from Twilio Console
  • Test phone numbers: +15005550006 (valid), +15005550001 (invalid)
  • Test verification codes: 123456 (valid), 000000 (invalid)

Security Considerations

  • Store Twilio credentials securely in configuration
  • Use environment variables for production deployments
  • Implement proper access controls for verification endpoints
  • Log verification attempts for audit purposes

License

This library is proprietary to Net3000. Usage is restricted to Net3000.ca solutions and authorized affiliates. Redistribution, sublicensing, or integration with third-party products outside the Net3000 ecosystem is prohibited without written consent from Net3000.

Support

For support and questions, contact the Net3000 development team or visit net3000.ca.

Changelog

v1.0.0

  • Initial release with SMS messaging capabilities
  • Phone verification with multi-channel support
  • Media message support for images
  • Comprehensive error handling and response management
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 99 10/4/2025

Initial release of Net3000 Twilio library with SMS messaging and phone verification capabilities.