Twilio NuGet Package Installation
The Twilio C#/.NET SDK makes it easy to interact with the Twilio API from your .NET application. The most recent version of the library can be found on NuGet. The Twilio C# SDK supports .NET applications written in C#, VB.Net, and F# that utilize the .NET Framework version 3.5 or higher or any .NET runtime supporting .NET Standard v1.4. If you are interested in migrating to the newer 5.x version of the Twilio C# SDK from the 4.x version, check out this guide.
NuGetでインストールする
Visual Studio IDEを使用する
From within Visual Studio, you can use the NuGet GUI to search for and install the Twilio NuGet package. Or, as a shortcut, simply type the following command into the Package Manager Console:
Install-Package Twilio
.NET Coreコマンドラインツールを使用する
.NET Coreのコマンドラインツールを使用して構築する場合は、プロジェクトディレクトリ内から次のコマンドを実行できます:
dotnet add package Twilio
インストールをテストする
このようにSMSメッセージ送信を試します
We also have an example in VB.NET and an example in F# if you use one of those languages.
.NET Frameworkバージョン4.5.1以降または.NET Core 1.0以上を使用している場合は、API呼び出しを非同期で行うこともできます。
The library automatically handles paging for you. With the Read
method, you can specify the number of records you want to receive (limit
) and the maximum size you want each page fetch to be (pageSize
). The library will then handle the task for you, fetching new pages under the hood as you iterate over the records.
For more information, view the auto-generated library docs.
DateTime values
All DateTime
values in the C# helper library are in your local timezone (Kind=Local
). Learn more details here on how to convert this to UTC or set UTC as your default.
追加ドキュメント
C# SDKのインストールが問題なく完了したら、最新版のライブラリーを使用しているREST APIドキュメント、および各Twilio製品のドキュメントがお役に立つでしょう。 またこちらで、自動生成された最新版のSDK用のJavadocもご活用ください。
バージョン4.xのSDKを使用する
C# SDKのもっとも最近のバージョンは、以前のTwilioアプリケーションで使用されている可能性のあるC# SDKの前バージョンである4.xと互換性がありません。 旧バージョンは引き続き機能し、引き続きドキュメント全体にわたってサンプルコードをご利用いただけます。 このバージョンのインストールが必要な場合、下記コマンドで行うことができます。
Install-Package Twilio -Version 4.7.2
.NET Coreは4.xバージョンのSDKとは互換性がない点に注意してください。
ヘルプ
We'd love to hear your feedback on the C# SDK, and help you past any issues you may encounter. Feel free to drop us a line, and we'll make sure to get you sorted!
ヘルプが必要ですか?
誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。