{"id":29622407,"url":"https://github.com/Vonage/vonage-dotnet-sdk","last_synced_at":"2025-07-21T04:09:10.360Z","repository":{"id":29466147,"uuid":"33002695","full_name":"Vonage/vonage-dotnet-sdk","owner":"Vonage","description":"Vonage REST API client for .NET, written in C#. API support for SMS, Voice, Text-to-Speech, Numbers, Verify (2FA) and more.","archived":false,"fork":false,"pushed_at":"2025-07-18T08:43:23.000Z","size":4294,"stargazers_count":111,"open_issues_count":6,"forks_count":87,"subscribers_count":30,"default_branch":"main","last_synced_at":"2025-07-18T10:21:39.680Z","etag":null,"topics":["c-sharp","developer-destination","dotnet","meetings","phone","proactive-connect","server-sdk","sms","sms-api","two-factor-authentication","verify","video","voice","voice-api","vonage"],"latest_commit_sha":null,"homepage":"https://developer.vonage.com/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Vonage.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-03-27T18:32:22.000Z","updated_at":"2025-07-18T06:03:46.000Z","dependencies_parsed_at":"2023-10-12T14:51:17.875Z","dependency_job_id":"0dfd9753-749d-4c2d-9d7f-232db059c5ef","html_url":"https://github.com/Vonage/vonage-dotnet-sdk","commit_stats":null,"previous_names":["vonage/vonage-dotnet"],"tags_count":144,"template":false,"template_full_name":null,"purl":"pkg:github/Vonage/vonage-dotnet-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vonage%2Fvonage-dotnet-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vonage%2Fvonage-dotnet-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vonage%2Fvonage-dotnet-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vonage%2Fvonage-dotnet-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vonage","download_url":"https://codeload.github.com/Vonage/vonage-dotnet-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vonage%2Fvonage-dotnet-sdk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266237048,"owners_count":23897317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-sharp","developer-destination","dotnet","meetings","phone","proactive-connect","server-sdk","sms","sms-api","two-factor-authentication","verify","video","voice","voice-api","vonage"],"created_at":"2025-07-21T04:09:08.405Z","updated_at":"2025-07-21T04:09:10.343Z","avatar_url":"https://github.com/Vonage.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"Vonage Client Library for .NET\n===================================\n\n[![](http://img.shields.io/nuget/v/Vonage.svg?style=flat-square)](https://www.nuget.org/packages/Vonage/)\n[![Build Status](https://github.com/Vonage/vonage-dotnet-sdk/actions/workflows/net-build.yml/badge.svg)](https://github.com/Vonage/vonage-dotnet-sdk/actions/workflows/net-build.yml/badge.svg)\n[![MultiFramework Build Status](https://github.com/Vonage/vonage-dotnet-sdk/actions/workflows/multiframework-build.yml/badge.svg)](https://github.com/Vonage/vonage-dotnet-sdk/actions/workflows/multiframework-build.yml/badge.svg)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Vonage_vonage-dotnet-sdk\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Vonage_vonage-dotnet-sdk)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=Vonage_vonage-dotnet-sdk\u0026metric=coverage)](https://sonarcloud.io/summary/new_code?id=Vonage_vonage-dotnet-sdk)\n[![CodeScene Code Health](https://codescene.io/projects/29782/status-badges/code-health)](https://codescene.io/projects/29782)\n[![Mutation testing badge](https://img.shields.io/endpoint?style=flat\u0026url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2FVonage%2Fvonage-dotnet-sdk%2FVonage%2Fmain)](https://dashboard.stryker-mutator.io/reports/github.com/Vonage/vonage-dotnet-sdk/Vonage/main)\n[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)\n\nThis library allows you to integrate feature from [Vonage's APIs](#supported-apis) to your application.\n\nIt requires you to create\na [Vonage account](https://dashboard.nexmo.com/sign-up?utm_source=DEV_REL\u0026utm_medium=github\u0026utm_campaign=csharp-client-library)\nfirst.\n\n* [Installation](#installation)\n    * [Migration guides](#migration-guides)\n        * [Upgrading from v7.x.x to v8.0.0](#upgrading-from-v7xx-to-v800)\n        * [Upgrading from v6.x.x to v7.0.0](#upgrading-from-v6xx-to-v700)\n        * [Upgrading from v5.x.x to v6.0.0](#upgrading-from-v5xx-to-v600)\n        * [Migrating from OpenTok for Video API](#migrating-from-opentok-for-video-api)\n    * [Targeted frameworks](#targeted-frameworks)\n    * [Tested frameworks](#tested-frameworks)\n* [Configuration](#configuration)\n    * [Setup](#setup)\n        * [Lazy registration (recommended for .NET Core and above)](#lazy-registration-recommended-for-net-core-and-above)\n        * [Manual initialization (recommended for .NET Framework)](#manual-initialization-recommended-for-net-framework)\n    * [Configuration reference](#configuration-reference)\n    * [Logging](#logging)\n* [Monads](#monads)\n    * [Result](#result)\n    * [Maybe](#maybe)\n    * [What if you don't want to use Monads?](#what-if-you-dont-want-to-use-monads)\n* [Supported APIs](#supported-apis)\n* [FAQ](#faq)\n* [Contributing](#contributing)\n* [Thanks](#thanks)\n* [Licence](#license)\n\n## Installation\n\n### Migration guides\n\n#### Upgrading from v7.x.x to v8.0.0\n\nPlease see the dedicated [migration guide](MIGRATION_v8.0.0.md).\n\n#### Upgrading from v6.x.x to v7.0.0\n\nPlease see the dedicated [migration guide](MIGRATION_v7.0.0.md).\n\n#### Upgrading from v5.x.x to v6.0.0\n\nChanges in version 6.0.0\n\n* Enum values are now capitalised in alignment with accepted coding practices and are Pascal Case\n* All classes that were marked as deprecated in 5.x are now removed\n* NCCO now inherits from List, it no longer has the `Actions` property, to add an action use `ncco.Add(action);`\n* Strings with values \"true\" or \"false\" are now represented as `bool` in code\n\n### Migrating from OpenTok for Video API\n\nIf you are migrating from the OpenTok .NET SDK to the Vonage .NET SDK, please see the\ndedicated [migration guide](OPENTOK_TO_VONAGE_MIGRATION.md).\n\n### Targeted frameworks\n\nThe SDK targets towards `netstandard2.0`.\nIt is compatible with any .NET projects targeting\na [supported version](https://learn.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-0).\n\n### Tested frameworks\n\n* .NET 6.0\n* .NET 7.0\n* .NET 8.0\n\nFor accessibility reasons, we removed all `.NET Framework` versions from our target frameworks.\nwe don't want to discourage people from contributing as Windows isn't the only development environment for .NET anymore.\n\nAlso, targeting older frameworks prevents us from using features from recent .NET and C# releases in our test project.\n\nNonetheless, it doesn't compromise our test results nor the compatibility with `.NET Framework` versions.\n\n## Configuration\n\n### Setup\n\nThere are various ways to initialize a `VonageClient` with your custom values.\n\nOverall, we encourage you to specify your configuration (Vonage URLs, credentials, etc.) in `appsettings.json`, in\nan `appsettings` section:\n\n```json\n{\n  \"vonage\": {\n    \"UserAgent\": \"myApp/1.0\",\n    \"Url.Rest\": \"https://rest.nexmo.com\",\n    \"Url.Api\": \"https://api.nexmo.com\",\n    \"Url.Api.EMEA\": \"https://api-eu.vonage.com\",\n    \"Url.Api.AMER\": \"https://api-us.vonage.com\",\n    \"Url.Api.APAC\": \"https://api-ap.vonage.com\",\n    \"Url.Api.Video\": \"https://video.api.vonage.com\",\n    \"Api.Key\": \"VONAGE-API-KEY\",\n    \"Api.Secret\": \"VONAGE-API-SECRET\",    \n    \"Application.Id\": \"ffffffff-ffff-ffff-ffff-ffffffffffff\",\n    \"Application.Key\": \"VONAGE_APPLICATION_PRIVATE_KEY\",\n    \"PooledConnectionIdleTimeout\": \"60\", \n    \"PooledConnectionLifetime\": \"600\", \n    \"Proxy\": \"https://example.com\"\n  }\n}\n```\n\nThe configuration is automatically loaded in the `Configuration` singleton.\n\n#### Lazy registration (recommended for .NET Core and above)\n\n\u003e Note: This implementation is not available for .NET Framework usages, given IConfiguration has been introduced in .NET\n\u003e Core.\n\nYou can register a client in your `IServiceCollection` using the following extension methods:\n\n- `AddVonageClientScoped`: registers using Scoped registration.\n- `AddVonageClientTransient`: registers using Transient registration.\n\n``` csharp\n// For 'Scoped' lifecycle\nbuilder.Services.AddVonageClientScoped(builder.Configuration);\n// Foor 'Transient' lifecycle\nbuilder.Services.AddVonageClientTransient(builder.Configuration);\n```\n\n\u003e Note: Using `builder.Configuration` allow us to use settings you decided to load at runtime, including\n\u003e environment-specific settings.\n\n``` csharp\nvar credentials = ...\n// For 'Scoped' lifecycle\nbuilder.Services.AddVonageClientScoped(credentials);\n// Foor 'Transient' lifecycle\nbuilder.Services.AddVonageClientTransient(credentials);\n```\n\nIt will register the main `VonageClient`, but also all sub client interfaces:\n\n- IMessagesClient\n- IVerifyV2Client\n- IMeetingsClient\n- IVoiceClient\n- etc.\n\nFinally, you can inject them in any of your components.\n\n#### Manual initialization (recommended for .NET Framework)\n\nCreate a Vonage Client instance and pass in credentials in the constructor;\nthis will only affect the security credentials (Api Key, Api Secret, Signing Secret, Signing Method Private Key, App\nId).\n\n```csharp\nvar credentials = Credentials.FromApiKeyAndSecret(\n    VONAGE_API_KEY,\n    VONAGE_API_SECRET\n    );\n\nvar vonageClient = new VonageClient(credentials);\n```\n\nIf required, you can override values directly in the `Configuration` singleton:\n\n```cshap\nConfiguration.Instance.Settings[\"vonage:Url.Api\"] = \"https://www.example.com/api\";\nConfiguration.Instance.Settings[\"vonage:Url.Rest\"] = \"https://www.example.com/rest\";\n```\n\n\u003e Note: Private Key is the literal key - not a path to the file containing the key\n\n\u003e Note: Modifying the Configuration instance will be deprecated in the upcoming release, to keep the configuration\n\u003e immutable.\n\n### Configuration Reference\n\n| Key                         | Description                                                                                                                      |\n|-----------------------------|----------------------------------------------------------------------------------------------------------------------------------|\n| Api.Key                     | Your API key from the [dashboard](https://dashboard.nexmo.com/settings)                                                          |\n| Api.Secret                  | Your API secret from the [dashboard](https://dashboard.nexmo.com/settings)                                                       |\n| Application.Id              | Your application ID                                                                                                              |\n| Application.Key             | Your application's private key                                                                                                   |\n| Security_secret             | Optional. This is the signing secret that's used for [signing SMS](https://developer.nexmo.com/concepts/guides/signing-messages) |\n| Signing_method              | Optional. This is the method used for signing SMS messages                                                                       |\n| Url.Rest                    | Optional. Vonage REST API base URL. Defaults to https://rest.nexmo.com                                                           |\n| Url.Api                     | Optional. Vonage API base URL. Defaults to https://api.nexmo.com                                                                 |\n| Url.Api.EMEA                | Optional. Vonage API base URL for Europe, Middle East and Africa. Defaults to https://api-eu.vonage.com                          |\n| Url.Api.AMER                | Optional. Vonage API base URL for North, Central and South America. Defaults to https://api-us.vonage.com                        |\n| Url.Api.APAC                | Optional. Vonage API base URL for Asia and Pacific. Defaults to https://api-ap.vonage.com                                        |\n| Url.Api.Video               | Optional. Vonage API base URL for Video. Defaults to https://video.api.vonage.com                                                |\n| RequestsPerSecond           | Optional. Throttle to specified requests per second.                                                                             |\n| RequestTimeout              | Optional.  The timeout (in seconds) applied to every request. If not provided, the default timeout will be applied.              |\n| UserAgent                   | Optional. Your app-specific usage identifier in the format of `name/version`. Example: `\"myApp/1.0\"`                             |\n| PooledConnectionIdleTimeout | Optional. The time (in seconds) that a connection can be idle before it is closed. Defaults to 60 seconds.                       |\n| PooledConnectionLifetime    | Optional. The time (in seconds) that a connection can be alive before it is closed. Defaults to 600 seconds.                     |\n| Proxy                       | Optional. Sets a custom proxy URL for all HTTP requests                                                                          |\n\n### Logging\n\nThe Library uses Microsoft.Extensions.Logging to preform all of it's logging tasks. To configure logging for you app\nsimply create a new `ILoggerFactory` and call the `LogProvider.SetLogFactory()` method to tell the Vonage library how to\nlog. For example, to log to the console with serilog you can do the following:\n\n```csharp\nusing Microsoft.Extensions.Logging;\nusing Microsoft.Extensions.Configuration;\nusing Vonage.Logger;\nusing Serilog;\n\nvar log = new LoggerConfiguration()\n    .MinimumLevel.Debug()\n    .WriteTo.Console(outputTemplate: \"{Timestamp:HH:mm} [{Level}]: {Message}\\n\")\n    .CreateLogger();\nvar factory = new LoggerFactory();\nfactory.AddSerilog(log);\nLogProvider.SetLogFactory(factory);\n```\n\n## Monads\n\nMost recent features expose responses/results\nusing [Monads](https://www.adit.io/posts/2013-04-17-functors,_applicatives,_and_monads_in_pictures.html#just-what-is-a-functor,-really?).\nWhile the name may be scary at first, this is just another data structure that offers various benefits.\nWe can picture them as a `box` containing our value, and we manipulate the box instead of manipulating a value.\n\nTheir purpose is to provide a value that can have multiple states, and deal with each state using a similar workflow.\nThis is a alternative to exception handling -\nsee [Railway Oriented Programming](https://fsharpforfunandprofit.com/posts/recipe-part2/).\n\n### Result\n\nThe `Result\u003cT\u003e` monad represents a value that can have one of the following states:\n\n- `Success` - indicates the process was a success\n- `Failure` - indicates the process failed\n\nThe goal is to provide an `exception-free` process.\n\n- Transparency - the signature is fully transparent about the possible outputs (aka. a method **can** fail)\n- Less intrusive - no `try-catch` required\n\n```csharp\n// This method allows to Divide a number\nprivate static Result\u003cdecimal\u003e Divide(decimal value, decimal divider) =\u003e\n    divider == 0\n        // If divider is 0, failure is returned\n        ? Result\u003cdecimal\u003e.FromFailure(ResultFailure.FromErrorMessage(\"Cannot divide by 0.\"))\n        // If divider is allowed, success is returned\n        : Result\u003cdecimal\u003e.FromSuccess(value / divider);\n```\n\n### Maybe\n\nThe `Maybe\u003cT\u003e` monad represents a value that can have one of the following states:\n\n- `Some` - indicates the presence of a value\n- `None` - indicates the absence of a value\n\nThe goal is to mitigate the 'billion-dollar mistake': `null`.\n\n```csharp\n// This method allows to retrieve phone number\nprivate static Maybe\u003cPhoneNumber\u003e Find(string number) =\u003e\n    this.numbers.FirstOrDefault(phoneNumber =\u003e phoneNumber.Number.Equals(number)) \n    ?? Maybe\u003cPhoneNumber\u003e.None;\n```\n\n### How to extract a value from a Monad?\n\nGiven we cannot predict the state at build-time, we need to provide an operation for **each** scenario.\n\nThe following methods are all available for both `Result\u003cT\u003e` and `Maybe\u003cT\u003e`, but examples will focus on `Result\u003cT\u003e`.\n\n#### Match\n\n`.Match()` expects two operations, and will evaluate the one corresponding to the current state.\nIt supports transformation, and can be used with both `Actions` and `Functions`.\n\n```csharp\nResult\u003cint\u003e monad = ...\n// Supports transformation    \nstring result = monad.Match(\n    // Will be executed if Result\u003cint\u003e.IsSuccess\n    some =\u003e $\"The process is a success: {some}.\",\n    // Will be executed if Result\u003cint\u003e.IsFailure \n    failure =\u003e $\"The process is a failure: {failure.GetFailureMessage()}\");\n\n// Using Actions    \nmonad.Match(\n    some =\u003e Console.WriteLine($\"The process is a success: {some}.\"),\n    failure =\u003e Console.WriteLine($\"The process is a failure: {failure.GetFailureMessage()}\"));\n```\n\n#### IfFailure / IfNone\n\nIf you want to retrieve the value without transforming it, you can use `.IfFailure()` which expects a fallback value in\ncase the state is `Failure`.\n\n```csharp\nResult\u003cint\u003e monad = ...\n// Using the failure reason (recommended)\nstring result = monad.IfFailure(failure =\u003e $\"The process is a failure: {failure.GetFailureMessage()}\");\n// Using a default value\nstring result = monad.IfFailure(\"Something failed.\");\n// Using an Action\nmonad.IfFailure(failure =\u003e Console.WriteLine($\"The process is a failure: {failure.GetFailureMessage()}\"));    \n```\n\n### Features\n\nBoth `Result\u003cT\u003e` and `Maybe\u003cT\u003e` also exposes more capabilities:\n\n- `Map`: transforms the value (if success/some) that will wrap the result into a new Monad.\n- `Bind`: transforms the value (if success/some) that will return a new Monad.\n- `Merge`: merges (or flatten) two monads.\n- `IfSuccess` / `IfSome`: provide an operation that will be executed if the Monad is in the expected state.\n- `IfFailure` / `IfNone`: provide an operation that will be executed if the Monad is in the expected state.\n- Implicit operators\n- Async support\n- etc.\n\nYou can see how to benefit from these capabilities\nin [our Tests](https://github.com/Vonage/vonage-dotnet-sdk/tree/main/Vonage.Common.Test/Monads).\n\n### What if you don't want to use Monads?\n\nYou can use `GetUnsafe()` if you prefer having an exception thrown when a Monad is not in the desired state.\n\n```csharp\nResult\u003cint\u003e result = ...\ntry\n{\n    int output = result.GetSuccessUnsafe();\n}\n// The exception type cannot be defined at build-time\n// It depends of the failure reason:\n// - Authentication failure\n// - Serialization/Deserialization failure\n// - Http failure\n// - Validation failure\n// - etc.\ncatch (Exception exception)\n{\n    ...\n}\n```\n\n```csharp\nMaybe\u003cint\u003e maybe = ...\ntry\n{\n    int output = maybe.GetUnsafe();\n}\ncatch (NoneStateException exception)\n{\n    ...\n}\n```\n\n## Supported APIs\n\nThe following is a list of Vonage APIs and whether the Vonage .NET SDK provides support for them:\n\n| API                     |  API Release Status  | Supported? |\n|-------------------------|:--------------------:|:----------:|\n| Account API             | General Availability |     ✅      |\n| Alerts API              | General Availability |     ✅      |\n| Application API         | General Availability |     ✅      |\n| Conversations API       | General Availability |     ✅      |\n| Messages API            | General Availability |     ✅      |\n| Number Insight API      | General Availability |     ✅      |\n| Number Insight V2 API   | General Availability |     ✅      |\n| Number Management API   | General Availability |     ✅      |\n| Number Verification API | General Availability |     ✅      |\n| Pricing API             | General Availability |     ✅      |\n| Redact API              |  Developer Preview   |     ✅      |\n| Reports API             |         Beta         |     ❌      |\n| SimSwap API             | General Availability |     ✅      |\n| SMS API                 | General Availability |     ✅      |\n| SubAccounts API         | General Availability |     ✅      |\n| Users API               | General Availability |     ✅      |\n| Verify API              | General Availability |     ✅      |\n| Verify V2 API           | General Availability |     ✅      |\n| Video API               | General Availability |     ✅      |\n| Voice API               | General Availability |     ✅      |\n\n## Contributing\n\nPick your preferred IDE:\n\n- Visual Studio (Community is fine)\n- Visual Studio Code\n- Jetbrains Rider\n\nKeep in mind the SDK is built on `netstandard2.0` and tested against several framework versions (.NET6.0 and above).\nTherefore, they should be installed on your machine for tests to run.\n\n1. Get the latest code either by cloning the repository or downloading a snapshot of the source.\n2. Open \"Vonage.sln\"\n3. Build! NuGet dependencies should be brought down automatically; check your settings if they are not.\n4. Tests! Run all the tests to verify everything's fine.\n\nPull requests are welcome!\n\n## License\n\nThis library is released under [the MIT License][license].\n\n[signup]: https://dashboard.nexmo.com/sign-up?utm_source=DEV_REL\u0026utm_medium=github\u0026utm_campaign=csharp-client-library\n\n[doc_sms]: https://developer.nexmo.com/api/sms?utm_source=DEV_REL\u0026utm_medium=github\u0026utm_campaign=csharp-client-library\n\n[doc_voice]: https://developer.nexmo.com/voice/voice-api/overview?utm_source=DEV_REL\u0026utm_medium=github\u0026utm_campaign=csharp-client-library\n\n[doc_verify]: https://developer.nexmo.com/verify/overview?utm_source=DEV_REL\u0026utm_medium=github\u0026utm_campaign=csharp-client-library\n\n[doc_app]: https://developer.nexmo.com/concepts/guides/applications?utm_source=DEV_REL\u0026utm_medium=github\u0026utm_campaign=csharp-client-library\n\n[doc_redact]: https://developer.nexmo.com/api/redact?utm_source=DEV_REL\u0026utm_medium=github\u0026utm_campaign=csharp-client-library\n\n[license]: LICENSE.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVonage%2Fvonage-dotnet-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FVonage%2Fvonage-dotnet-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVonage%2Fvonage-dotnet-sdk/lists"}