SMSC 1.0.9
dotnet add package SMSC --version 1.0.9
NuGet\Install-Package SMSC -Version 1.0.9
<PackageReference Include="SMSC" Version="1.0.9" />
paket add SMSC --version 1.0.9
#r "nuget: SMSC, 1.0.9"
// Install SMSC as a Cake Addin #addin nuget:?package=SMSC&version=1.0.9 // Install SMSC as a Cake Tool #tool nuget:?package=SMSC&version=1.0.9
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
- Http sms send manager (documentation)
- Http sms status manager (documentation)
- Http balance manager (documentation)
In the future, we plan to implement:
- Http mailing manager (documentation)
- Http contact manager (documentation)
- Http client manager (documentation)
- Http sender names manager (documentation)
- Http data (history) manager (documentation)
- Connecting dedicated numbers to receive messages (documentation)
- Confirming a phone number with a call (documentation)
- Actions with deferred tasks (documentation)
Product | Versions 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. |
-
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.