SMSC 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package SMSC --version 1.0.1                
NuGet\Install-Package SMSC -Version 1.0.1                
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.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SMSC --version 1.0.1                
#r "nuget: SMSC, 1.0.1"                
#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.
// Install SMSC as a Cake Addin
#addin nuget:?package=SMSC&version=1.0.1

// Install SMSC as a Cake Tool
#tool nuget:?package=SMSC&version=1.0.1                

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 inititate 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
};

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.

Get status

To check the SMS or e-mail delivery status, you must initiate ProviderConfiguration:

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 HttpSmsStatus class:

var httpSmsStatus = new HttpSmsStatus(providerConfig);


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

var smsStatusConfig = new SmsStatusConfiguration()
{
    Id = id
};

if you need to get additional information:

var smsStatusConfig = new SmsStatusConfiguration()
{
    Id = id,
    StatusType = StatusType.Additional
};

id - the ID sent in response from previous step. And finally we send a request to server:

var statusResult = await httpSmsStatus.CheckSms("+79999999999", smsStatusConfig);

The result is returned as a class object HttpSmsStatusResponse.

Get balance

To get a balance you need to inititate 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 HttpSmsBalance class:

var httpSmsBalance = new HttpSmsBalance(providerConfig);


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

var smsBalanceConfig = new SmsBalanceConfiguration();

And finally we send a request to server:

var balanceResult = await httpSmsBalance.CheckBalance(smsBalanceConfig);

The result is returned as a class object HttpSmsBalanceResponse.

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

In the future, we plan to implement:

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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

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.9 73 12/20/2024
1.0.8 80 12/17/2024
1.0.7 75 12/15/2024
1.0.2 78 12/14/2024
1.0.1 81 12/13/2024

1. Корректирование README.md