UniSdk 0.3.0

dotnet add package UniSdk --version 0.3.0
NuGet\Install-Package UniSdk -Version 0.3.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="UniSdk" Version="0.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add UniSdk --version 0.3.0
#r "nuget: UniSdk, 0.3.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 UniSdk as a Cake Addin
#addin nuget:?package=UniSdk&version=0.3.0

// Install UniSdk as a Cake Tool
#tool nuget:?package=UniSdk&version=0.3.0

Unimatrix .NET SDK

NuGet Release GitHub license

The Unimatrix .NET SDK provides convenient access to integrate communication capabilities into your .NET applications using the Unimatrix HTTP API. The SDK provides support for sending SMS, 2FA verification, and phone number lookup.

Getting started

Before you begin, you need an Unimatrix account. If you don't have one yet, you can sign up for an Unimatrix account and get free credits to get you started.

Documentation

Check out the documentation at unimtx.com/docs for a quick overview.

Installation

The recommended way to install the Unimatrix SDK for .NET is to use the nuget package manager, which is available on NuGet.

If you are building with the .NET CLI, run the following command to add UniSdk as a dependency to your project:

dotnet add package UniSdk

If you are using the Visual Studio IDE, run the following command in the Package Manager Console:

Install-Package UniSdk

Usage

The following example shows how to use the Unimatrix .NET SDK to interact with Unimatrix services.

Initialize a client

using UniSdk;

var client = new UniClient("your access key id", "your access key secret");

or you can configure your credentials by environment variables:

export UNIMTX_ACCESS_KEY_ID=your_access_key_id
export UNIMTX_ACCESS_KEY_SECRET=your_access_key_secret

Send SMS

Send a text message to a single recipient.


using System;
using UniSdk;

class Program
{
    static void Main(string[] args)
    {
        var client = new UniClient("your access key id", "your access key secret");

        try
        {
            var resp = client.Messages.Send(new {
                to = "+1206880xxxx",  // in E.164 format
                text = "Your verification code is 2048."
            });
            Console.WriteLine(resp.Data);
        }
        catch (UniException ex)
        {
            Console.WriteLine(ex);
        }
    }
}

or use async method:

using System;
using System.Threading.Tasks;
using UniSdk;

class Program
{
    static async Task Main(string[] args)
    {
        var client = new UniClient();

        try
        {
            var resp = await client.Messages.SendAsync(new {
                // ...
            });
            Console.WriteLine(resp.Data);
        }
        catch (UniException ex)
        {
            Console.WriteLine(ex);
        }
    }
}

Send verification code

Send a one-time passcode (OTP) to a recipient. The following example will automatically generate a verification code.

using System;
using UniSdk;

class Program
{
    static void Main(string[] args)
    {
        var client = new UniClient();
        var resp = client.Otp.Send(new {
            to = "+1206880xxxx"
        });
        Console.WriteLine(resp.Data);
    }
}

Check verification code

Verify the one-time passcode (OTP) that a user provided. The following example will check whether the user-provided verification code is correct.

using System;
using UniSdk;

class Program
{
    static void Main(string[] args)
    {
        var client = new UniClient();
        var resp = client.Otp.Verify(new {
            to = "+1206880xxxx",
            code = "123456" // the code user provided
        });
        Console.WriteLine(resp.Valid);
    }
}

Reference

Other Unimatrix SDKs

To find Unimatrix SDKs in other programming languages, check out the list below:

License

This library is released under the MIT 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. 
.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
0.3.0 162 7/28/2023
0.2.1 176 12/20/2022