Git Product home page Git Product logo

nexmo-dotnet's Introduction

Nexmo Client Library for C#/.NET

You can use this C# client library to add Nexmo's API to your application. To use this, you'll need a Nexmo account. Sign up for free at nexmo.com.

Installation:

To use the client library you'll need to have created a Nexmo account.

To install the C# client library using NuGet:

  • Run the following command in the Package Manager Console:
    Install-Package Nexmo.Csharp.Client

Alternatively:

  • Download or build (see developer instructions) the Nexmo.Api.dll.
  • If you have downloaded a release, ensure you are referencing the Newtonsoft.Json.dll dependency by either including it with your project's NuGet dependencies or manually referencing it.
  • Reference the assembly in your code.

Configuration:

  • Provide your API key, secret, and nexmo URLs in appSettings:
<add key="Nexmo.Url.Rest" value="https://rest.nexmo.com" />
<add key="Nexmo.Url.Api" value="https://api.nexmo.com" />
<add key="Nexmo.api_key" value="<YOUR KEY>" />
<add key="Nexmo.api_secret" value="<YOUR SECRET>" />

Examples

The following examples show how to:

Sending A Message

Use Nexmo's SMS API to send a SMS message.

var results = SMS.Send(new SMS.SMSRequest
{
    from = "15555551212",
    to = "17775551212",
    text = "this is a test"
});

Receiving a Message

Use Nexmo's SMS API to receive a SMS message. Assumes your Nexmo endpoint is configured.

public ActionResult Get([FromUri]SMS.SMSDeliveryReceipt response)
{
    return new HttpStatusCodeResult(HttpStatusCode.OK);
}

Initiating a Call

Use Nexmo's Call API to initiate a voice call.

var result = Voice.Call(new Voice.CallCommand
{
    to = "17775551212",
    answer_url = "https://abcdefgh.ngrok.io/content/voiceDemo.xml",
    status_url = "https://abcdefgh.ngrok.io/api/voice",
    from = "15555551212",
});

Additional Examples

  • Check out the sample MVC application and tests for more examples. Make sure to copy web.config.example to web.config and enter your key/secret.

API Coverage

  • Account
    • Balance
    • Pricing
    • Settings
    • Top Up
    • Numbers
      • Search
      • Buy
      • Cancel
      • Update
  • Number Insight
    • Basic
    • Standard
    • Advanced
    • Webhook Notification
  • Verify
    • Verify
    • Check
    • Search
    • Control
  • Search
    • Message
    • Messages
    • Rejections
  • Messaging
    • Send
    • Delivery Receipt
    • Inbound Messages
    • Search
      • Message
      • Messages
      • Rejections
    • US Short Codes
      • Two-Factor Authentication
      • Event Based Alerts
        • Sending Alerts
        • Campaign Subscription Management
  • Voice
    • Outbound Calls
    • Inbound Call
    • Text-To-Speech Call
    • Text-To-Speech Prompt

Contributing

We are currently targeting the 4.5.2 - 4.6.1 frameworks and using Visual Studio 2015 Update 1.

  1. Get latest code either by cloning the repository or downloading a snapshot of the source.
  2. Open "Nexmo.Api.sln"
  3. Build! NuGet dependencies should be brought down automatically; check your settings if they are not.

Pull requests are welcome!

License

This library is released under the MIT License

nexmo-dotnet's People

Contributors

smithrobs avatar jonferreira avatar

Stargazers

Iain avatar

Watchers

James Cloos avatar Iain avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.