FarazSMS 1.1.2

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

FarazSMS (.NET)

FarazSMS · IranPayamak — فراز اس ام اس · ایران پیامک

Official .NET client for the FarazSMS / IranPayamak web services.

Wraps all 63 endpoints — pattern/OTP sending, bulk SMS, reports, phonebook, and more. Uses only System.Net.Http.HttpClient and System.Text.Json — no external dependencies.

Install

dotnet add package FarazSMS

Quick start

using System;
using System.Threading.Tasks;
using FarazSMS;

class Program
{
    static async Task Main()
    {
        var client = new FarazSMS("YOUR_API_KEY");

        // Account balance
        var balance = await client.Balance();
        Console.WriteLine(balance);

        // Send an OTP / pattern message
        await client.SendPattern(
            code: "abc123",
            recipient: "09123456789",
            attributes: new { code = "5821", name = "Ali" });

        // Send a simple bulk message
        await client.SendSimple(
            "Hello from FarazSMS!",
            new[] { "09123456789", "09120000000" });

        try
        {
            await client.Balance();
        }
        catch (FarazException ex)
        {
            Console.WriteLine($"Error {ex.StatusCode}: {ex.Message}");
        }
    }
}

Authentication uses the Api-Key header (case-sensitive). The default sender line is 90008361, and every send includes "number_format": "english".

Methods

Category Method HTTP Endpoint
Low-level Request(method, path, body, query) * any
Account Balance() GET /ws/v1/account/balance
Account Profile() GET /ws/v1/account/profile
Account Lines() GET /ws/v1/lines/accessible
Send SendPattern(code, recipient, attributes, line) POST /ws/v1/sms/pattern
Send SendSimple(text, recipients, line) POST /ws/v1/sms/simple
Send SendVariable(text, recipients, line) POST /ws/v1/sms/keywords
Patterns CreatePattern(payload) POST /ws/v1/patterns
Patterns Patterns(query) GET /ws/v1/patterns
Reports Inbox(page, limit) GET /ws/v1/inbox
Reports SendRequests(query) GET /ws/v1/send_request
Reports SendRequestItems(id, query) GET /ws/v1/send_request/{id}/items
Phonebook Phonebooks() GET /ws/v1/phone_book
Phonebook AddContact(payload) POST /ws/v1/phone_book_data
Reference Provinces() GET /provinces
Reference NumberBanks() GET /ws/v1/number_bank

All methods return Task<JsonElement> and throw FarazException (carrying the HTTP status code and message) on an error envelope.

License

MIT — see LICENSE.

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 was computed.  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. 
.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 is compatible.  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.2 154 6/21/2026
1.1.1 117 6/21/2026
1.1.0 120 6/20/2026
1.0.1 115 6/18/2026