AsthaIT.SMSGateway 1.0.0

dotnet add package AsthaIT.SMSGateway --version 1.0.0
                    
NuGet\Install-Package AsthaIT.SMSGateway -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="AsthaIT.SMSGateway" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AsthaIT.SMSGateway" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="AsthaIT.SMSGateway" />
                    
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 AsthaIT.SMSGateway --version 1.0.0
                    
#r "nuget: AsthaIT.SMSGateway, 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.
#addin nuget:?package=AsthaIT.SMSGateway&version=1.0.0
                    
Install AsthaIT.SMSGateway as a Cake Addin
#tool nuget:?package=AsthaIT.SMSGateway&version=1.0.0
                    
Install AsthaIT.SMSGateway as a Cake Tool

# AIT.Packages.SMSGateway

A .NET client library for sending SMS messages through the SMS Gateway. It offers a straightforward interface for sending both single and bulk messages via the API.

AITSSLWirelessSMSClient

This client is designed to work with the SSL Wireless SMS Gateway, allowing developers to easily integrate SMS functionality into their .NET applications. It supports both single and bulk SMS sending, with strong typing for request and response models.

Features

  • Send single SMS messages asynchronously
  • Send bulk SMS messages asynchronously
  • Strongly-typed request and response models
  • Designed for .NET 8 and .NET 9

Installation

dotnet add package AsthaIT.SMSGateway

Usage

Initialization

using AIT.Packages.SMSGateway.SSLWireless;
var client = new AITSSLWirelessSMSClient( apiToken: "your_api_token", sId: "your_sid", url: "your_gateway_urrl" );

Send a Single SMS

var singleRequest = new SingleSMSRequest
{
    RecipientNumber = "01XXXXXXXXX",
    SMSBody = "Hello from ASTHAIT!",
    CsmsId = DateTime.UtcNow.Ticks.ToString("D18") // Each SMS will have a unique 18-character alphanumeric reference ID. The CsmsId will be unique for the same day only.
};

var response = await client.SendSMSAsync(singleRequest);

if (response.IsSuccess)
{
    if (response.Status == SMSStatus.SUCCESS)
    {
        Console.WriteLine($"Message sent successfully: {response.Status}");
    }
    else
    {
        Console.WriteLine($"Message sending failed: {response.ErrorMessage}");
    }
}
else
{
    Console.WriteLine($"Failed to send message: {response.ErrorMessage}");
}

Send Bulk SMS

var bulkRequest = new BulkSMSRequest
{
    RecipientNumbers = new List<string>
    {
        "01XXXXXXXXX",
        "01YYYYYYYYY"
    },
    SMSBody = "Hello from ASTHAIT!",
    CsmsId = DateTime.UtcNow.Ticks.ToString("D18")
};

var bulkResponse = await client.SendBulkSMSAsync(bulkRequest);

if (bulkResponse.IsSuccess)
{
    if (bulkResponse.Data.Status == SMSStatus.SUCCESS)
    {
        foreach (var message in bulkResponse.Data.Messages)
        {
            Console.WriteLine($"Message sent successfully: {message.Status}");
        }
    }
    else
    {
        Console.WriteLine($"Message sending failed: {bulkResponse.Data.ErrorMessage}");
    }
}
else
{
    Console.WriteLine($"Failed to send bulk messages: {bulkResponse.ErrorMessage}");
}

Configuration

  • ApiToken: Provided by SSL Wireless.
  • SID: Sender ID, provided by SSL Wireless.
  • HostUrl: API endpoint URL (differs for single and bulk SMS). Provided by SSL Wireless

License

MIT License

Author

Developed and maintained by AIT.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  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 161 6/3/2025