SMSC 1.1.0

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

SMSC

SMSC is an unofficial client .NET for the service smsc.ru that allows developers to use HTTP-based API for sending and receiving phone calls and text messages.

Quick start

Send SMS

The examples below show how to have your application initiate and outbound phone call and send an SMS message using the SMSC helper library.

To get started, first add the SMSC package to your project by running the following command:

dotnet add package SMSC

or for Visual Studio package manager:

Install-Package SMSC

You need to initiate a new instance of ProviderConfiguration with credentials:

var providerConfig = new ProviderConfiguration(login, password);

or you can initiate ProviderConfiguration with an apikey that you created in advance (access passwords page)

var providerConfig = new ProviderConfiguration(apiKey);

Create request manager from HttpSms class:

var httpSmsSender = new HttpSms(providerConfig);

Next, you need to create a configuration class object of SmsConfiguration with properties you need:

var smsConfig = new SmsConfiguration();

if you need to send a code in the form of a call:

var smsConfig = new SmsConfiguration()
{
    SmsType = SmsType.Call
};

WhatsApp (bot required in wa: format per docs):

var smsConfig = new SmsConfiguration()
{
    SmsType = SmsType.WhatsApp,
    BotName = "wa:79888888888"
};
var result = await httpSmsSender.SendSms("+79999999999", "Hello {button,tel:+79999999999,Call}", smsConfig);

Telegram:

var smsConfig = new SmsConfiguration()
{
    SmsType = SmsType.Telegram,
    BotName = "@botname_bot"
};

after that, we send a message

var result = await httpSmsSender.SendSms("+79999999999", "123456", smsConfig);

That is all you need to send a message to the client. The result is returned as a class object HttpSmsResponse.

Optional JSON REST body (https://smsc.ru/rest/send/):

httpSmsSender.UseJsonRequestFormat = true;

Get status

var providerConfig = new ProviderConfiguration(login, password);
var httpSmsStatus = new HttpSmsStatus(providerConfig);
var smsStatusConfig = new SmsStatusConfiguration()
{
    Id = id,
    StatusType = StatusType.Additional
};
var statusResult = await httpSmsStatus.CheckSms("+79999999999", smsStatusConfig);

Batch check (comma-separated ids/phones in API):

var statusResult = await httpSmsStatus.CheckSms(
    phones: ["+79999999999", "+78888888888"],
    ids: ["123", "456"],
    config: new SmsStatusConfiguration { Id = null });

Telegram-bot message status:

var statusResult = await httpSmsStatus.CheckSms(
    client: string.Empty,
    config: new SmsStatusConfiguration { Id = null, Bot = true });

Get balance

var httpSmsBalance = new HttpSmsBalance(providerConfig);
var balanceResult = await httpSmsBalance.CheckBalance(new SmsBalanceConfiguration());

Wait call (phone confirmation)

var waitCall = new HttpWaitCall(providerConfig);
var waitResult = await waitCall.RequestAsync("+79999999999");
// waitResult.Phone — number to call within 15 minutes

Contacts

var contacts = new HttpContacts(providerConfig);
await contacts.AddAsync("+79999999999", name: "Contact", groupId: "321");
await contacts.GetGroupsAsync();

Jobs (mailings)

var jobs = new HttpJobs(providerConfig);
await jobs.AddAsync(new JobsConfiguration
{
    Name = "Privet",
    Phones = "79999999999",
    Message = "Hello!"
});

History / senders / users / receive / downloads

var history = new HttpHistory(providerConfig);
await history.GetMessagesAsync(new HistoryConfiguration { Start = "01.01.2024", End = "01.02.2024" });

var senders = new HttpSenders(providerConfig);
await senders.GetAsync();

var users = new HttpUsers(providerConfig);
await users.GetStatAsync();

var receive = new HttpReceivePhones(providerConfig);
await receive.GetAsync();

var downloads = new HttpDownloads(providerConfig);
await downloads.GetListAsync();

Documentation

This README aims to give a quick start guide - including enough to get you to quickly start sending SMS. For deeper detail of all properties go to API Documentation, and many other aspects of smsc.ru.

Implemented features

Transport notes aligned with SMSC docs:

  • Host failover www1www5.smsc.ru on empty responses
  • POST for mail/call, attachments, and long query strings
  • Message max length 1000 characters (MessageMaxLengthException)
  • WhatsApp via bot=wa:… (not legacy whatsapp=1)
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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 is compatible.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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.1.0 62 8/8/2026
1.0.11 6,364 3/11/2025
1.0.9 2,215 12/20/2024
1.0.8 2,230 12/17/2024
1.0.7 2,199 12/15/2024
1.0.2 2,215 12/14/2024
1.0.1 2,239 12/13/2024