Arad.SMS.Core.DotNetSDK
1.0.0
dotnet add package Arad.SMS.Core.DotNetSDK --version 1.0.0
NuGet\Install-Package Arad.SMS.Core.DotNetSDK -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="Arad.SMS.Core.DotNetSDK" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Arad.SMS.Core.DotNetSDK --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Arad.SMS.Core.DotNetSDK, 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.
// Install Arad.SMS.Core.DotNetSDK as a Cake Addin #addin nuget:?package=Arad.SMS.Core.DotNetSDK&version=1.0.0 // Install Arad.SMS.Core.DotNetSDK as a Cake Tool #tool nuget:?package=Arad.SMS.Core.DotNetSDK&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Arad SMS Core SDK for send and receive SMS via API
public class Program
{
private static IMessage _aradMessage;
private static async Task Main()
{
Console.WriteLine("Hello Arad!");
_aradMessage = new Message("https://api.aradvas.ir");
SendAradA2PMessage();
}
private static async ValueTask<string> GetToken()
{
return await _aradMessage.GetToken("UserName", "Password", "ApiAccess", CancellationToken.None);
}
private static async ValueTask SendAradA2PMessage()
{
List<AradA2PMessage> list = new() { new() { DestinationAddress = "989123456789", SourceAddress = "9890001234", MessageText = "Hello Arad!", DataCoding = Enums.DataCodings.Default } };
HttpResponseMessage response = await _aradMessage.Send(list, await GetToken(), false, CancellationToken.None);
if (response.StatusCode == HttpStatusCode.OK)
{
ResultApiClass<List<string>> batchIds = JsonConvert.DeserializeObject<ResultApiClass<List<string>>>(await response.Content.ReadAsStringAsync());
Console.Write(JsonConvert.SerializeObject(batchIds));
}
}
private static async ValueTask SendAradBulkMessage()
{
AradBulkMessage list = new() { DestinationAddress = { "989123456789", "989129876543" }, SourceAddress = "9890001234", MessageText = "Hello Arad!" };
HttpResponseMessage response = await _aradMessage.SendBulk(list, await GetToken(), false, CancellationToken.None);
if (response.StatusCode == HttpStatusCode.OK)
{
ResultApiClass<List<string>> batchIds = JsonConvert.DeserializeObject<ResultApiClass<List<string>>>(await response.Content.ReadAsStringAsync());
Console.Write(JsonConvert.SerializeObject(batchIds));
}
}
private static async ValueTask GetDelivery()
{
List<string> messageIds = new() { "64587abc831e4ec10a883dcd", "64587abc831e4ec10a883hgf" };
List<DLRStatus> response = await _aradMessage.GetDLR(messageIds, await GetToken(), false, CancellationToken.None);
Console.Write(JsonConvert.SerializeObject(response));
}
private static async ValueTask GetMo()
{
List<Inbox> response = await _aradMessage.GetMO(false, await GetToken(), CancellationToken.None);
Console.Write(JsonConvert.SerializeObject(response));
}
private static async ValueTask GetMoByDate()
{
List<Inbox> response = await _aradMessage.GetMOByDate(DateTime.Now.AddMinutes(-20), DateTime.Now, false, await GetToken(), CancellationToken.None);
Console.Write(JsonConvert.SerializeObject(response));
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net5.0
- Flurl (>= 3.0.7)
- Microsoft.Extensions.Hosting (>= 7.0.1)
- Microsoft.Extensions.Hosting.Abstractions (>= 7.0.0)
- Microsoft.Extensions.Http (>= 7.0.0)
- Newtonsoft.Json (>= 13.0.3)
- System.Net.Http (>= 4.3.4)
-
net6.0
- Flurl (>= 3.0.7)
- Microsoft.Extensions.Hosting (>= 7.0.1)
- Microsoft.Extensions.Hosting.Abstractions (>= 7.0.0)
- Microsoft.Extensions.Http (>= 7.0.0)
- Newtonsoft.Json (>= 13.0.3)
- System.Net.Http (>= 4.3.4)
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 | 212 | 6/6/2023 |