Warning
This repository is no longer updated or maintained.
An easy-to-use .NET client library for NetSapiens REST API.
Add to your project using Nuget.
From Visual Studio, click the Tools menu -> NuGet Package Manager -> Package Manager Console.
From the console, run the following command:
Install-Package NetSapiensSharp
All examples below assume you have completed this and have connector
instantiated
class Example
{
static string API_BASE_URL = "http://ip.to.netsapiens/ns-api";
static string CLIENT_ID = "clientId";
static string CLIENT_SECRET = "ea52004d4d167c65198f211b33a989ae";
static string USERNAME = "100@domain";
static string PASSWORD = "123456";
static void Main()
{
using (var connector = new Connector(API_BASE_URL, CLIENT_ID, CLIENT_SECRET, USERNAME, PASSWORD))
{
var domains = Objects.Domain.List(connector, territory: "territory_name");
}
}
}
// where connector was created in basic example at beginning of readme
// where domain_name is the company's domain and 123 is the extension number
var list = Objects.PhoneNumber.ListByUser(connector, "domain_name", "123");
var response = Objects.PhoneNumber.CreateForDomain(connector, "domain_name", "2125551234");
// where domain_name is the domain, 2125551234 is the DID to assign, and 123 is the extension to assign to
var response = Objects.PhoneNumber.AssignToUser(connector, "domain_name", "2125551234", "123");
var list = Objects.Domain.List(connector, territory: "territory_name");
var domain = new Objects.Domain.item() {
domain = "domain_name",
territory = "territory_name",
dial_plan = "dial_plan",
description = "example description"
};
var response = Objects.Domain.Create(connector, domain);
var domain = new Objects.Domain.item() {
domain = "domain_name",
territory = "territory_name",
dial_plan = "dial_plan",
description = "new description"
};
var response = Objects.Domain.Update(connector, domain);
var response = Objects.Domain.Delete(connector, domain: "domain_to_delete");
// examples to be written
// examples to be written
// examples to be written
// examples to be written
// examples to be written
// examples to be written
// examples to be written
// examples to be written
// examples to be written
// examples to be written
// examples to be written
// examples to be written
- Download the latest version of NuGet Pack and place in Tools directory
- Update NetSapiensSharp.nuspec with new version (if necessary)
- Build NetSapiensSharp project in Release mode (IMPORTANT)
- Run build.bat
- Package should be available for download in Build directory