.NET (C#) SDK
The Plivo .NET SDK makes it simpler to integrate communications into your .NET applications using the Plivo REST APIs. Using the SDK, you’ll be able to make voice calls, send SMS messages, and generate Plivo XML documents to control your call flows.
Supported .NET versions: This SDK was written targeting at .NET Standard 1.3, and thus works with .NET Framework 4.6 and higher and .NET Core 1.0 and higher. Check here to know about all the other supported platforms.
Prerequisites
- .NET Framework 4.6 or higher, or .NET Core 1.0 or higher
- NuGet, a free and open source package manager
Installation
You can install this SDK either by referencing the .dll file or by using NuGet.
To install the latest SDK using the NuGet CLI:
To use NuGet to install the SDK in Visual Studio:
You can also use the .NET CLI to install the package:
Getting started
Authentication
To make the API requests, you need to create a PlivoApi instance and provide it with authentication credentials, which you can find on the Overview page of the Plivo console.
Replace the auth placeholders with your authentication credentials from the Plivo console.
The basics
The SDK uses consistent interfaces to create, retrieve, update, delete, and list resources. The pattern is:
Using api.Resource.List() lists the first 20 resources by default (the first page, with limit as 20, and offset as 0). Use limit and offset to get more pages of resources.
Examples
Send a message
Replace the auth placeholders with your authentication credentials from the Plivo console. Replace the phone number placeholders with actual phone numbers in E.164 format (for example, +12025551234).
Make a call
Generate Plivo XML
This generates the following XML:
More examples
Refer to the Plivo API Reference documentation for more examples.
Reporting issues
Report feedback or problems with this SDK by opening an issue on GitHub.