Skip to content

Localvox/vivialconnect-dotnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VivialConnect Client Library for .NET

VivialConnect is a simple SMS/MSS API. It's designed specifically for developers seeking a simple, affordable and scalable messaging solution.

Get your API key here: https://www.vivialconnect.net/register
Be sure to read the API documentation: https://www.vivialconnect.net/docs

Installation

You can add the VivialConnect library to your .NET project through the NuGet package manager. From within the Visual Studio IDE, use the NuGet GUI to search for and install the VivialConnect package.

Examples

Initialize Client: This only needs to be done once but is needed before attempting to use any resource.

using VivialConnect;

class Program
{
   static void Main(string[] args)
   {
       VcClient.Init(12345, "my-api-key", "my-api-secret");
...

Updates your Account company name:

using VivialConnect;
using VivialConnect.Resources.Account;

class Program
{
   static void Main(string[] args)
   {
       VcClient.Init(12345, "my-api-key", "my-api-secret");
       
       Account account = Account.FindSingle();
       account.CompanyName = "My Updated Company Name";
       account.Save();
   }
}

Search for and buy a number:

using VivialConnect;
using VivialConnect.Resources.Number;

class Program
{
   static void Main(string[] args)
   {
       VcClient.Init(12345, "my-api-key", "my-api-secret");
       
       List<NumberAvailable> numbersAvailable = Number.FindAvailable(inRegion: RegionEnum.CA);
       Number number = numbersAvailable[0].Buy();
   }
}

Send text message:

using VivialConnect;
using VivialConnect.Resources.Message;

class Program
{
   static void Main(string[] args)
   {
       VcClient.Init(12345, "my-api-key", "my-api-secret");
       
       Message message = Message.Send("+13105551111", "+15309992222", body: "Hello, from Vivial Connect!");
   }
}

Create a Connector:

using VivialConnect;
using VivialConnect.Resources.Connector;

class Program
{
   static void Main(string[] args)
   {
       VcClient.Init(12345, "my-api-key", "my-api-secret");
       
       Connector connector = new Connector();
       connector.Name = "My New Connector";
       connector.Callbacks.Add(new CallbackIncoming() { MessageType = MessageTypeEnum.Text, Url = "path/to/sms/callback1", Method = "POST" });
       connector.Numbers.Add(new ConnectorNumber("+15309992222"));
       connector.Save();
   }
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages