{"id":13570604,"url":"https://github.com/twilio/twilio-csharp","last_synced_at":"2025-08-07T01:52:10.807Z","repository":{"id":664433,"uuid":"307495","full_name":"twilio/twilio-csharp","owner":"twilio","description":"Twilio C#/.NET Helper Library for .NET6+.","archived":false,"fork":false,"pushed_at":"2025-07-24T08:01:45.000Z","size":57252,"stargazers_count":694,"open_issues_count":36,"forks_count":309,"subscribers_count":96,"default_branch":"main","last_synced_at":"2025-08-01T07:54:16.232Z","etag":null,"topics":["api","mms","phone","sms","telephony","twilio","twiml","video","voice","wireless"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"jscruggs/metric_fu","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/twilio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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":"2009-09-15T06:32:31.000Z","updated_at":"2025-07-25T14:15:04.000Z","dependencies_parsed_at":"2024-03-19T11:47:04.267Z","dependency_job_id":"50a2cf76-2000-4ae2-91d1-5024e576ce6f","html_url":"https://github.com/twilio/twilio-csharp","commit_stats":{"total_commits":1340,"total_committers":94,"mean_commits":14.25531914893617,"dds":0.85,"last_synced_commit":"62e7d609d49e0dcaa7c6b4c43f101019ecde8338"},"previous_names":[],"tags_count":317,"template":false,"template_full_name":null,"purl":"pkg:github/twilio/twilio-csharp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twilio%2Ftwilio-csharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twilio%2Ftwilio-csharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twilio%2Ftwilio-csharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twilio%2Ftwilio-csharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/twilio","download_url":"https://codeload.github.com/twilio/twilio-csharp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twilio%2Ftwilio-csharp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269185779,"owners_count":24374633,"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","status":"online","status_checked_at":"2025-08-06T02:00:09.910Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api","mms","phone","sms","telephony","twilio","twiml","video","voice","wireless"],"created_at":"2024-08-01T14:00:53.596Z","updated_at":"2025-08-07T01:52:10.795Z","avatar_url":"https://github.com/twilio.png","language":"C#","readme":"# twilio-csharp\n\n[![Test](https://github.com/twilio/twilio-csharp/actions/workflows/test-and-deploy.yml/badge.svg)](https://github.com/twilio/twilio-csharp/actions/workflows/test-and-deploy.yml)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=twilio_twilio-csharp\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=twilio_twilio-csharp)\n[![NuGet](https://img.shields.io/nuget/v/Twilio.svg)](https://www.nuget.org/packages/Twilio)\n[![Learn with TwilioQuest](https://img.shields.io/static/v1?label=TwilioQuest\u0026message=Learn%20to%20contribute%21\u0026color=F22F46\u0026labelColor=1f243c\u0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e/X7JgfkucBMIAr26ndnB4UCLnDOqvteQsHlgX9N4A+c4cW3DXSPbwAAAABJRU5ErkJggg==)](https://twil.io/learn-open-source)\n\n## Twilio REST API and TwiML Libraries for .NET\n\nTwilio provides a HTTP-based API for sending and receiving phone calls and text messages. Learn more on [twilio.com][apidocs].\n\nMore documentation for this library can be found [here][libdocs].\n\n## Versions\n\n`twilio-csharp` uses a modified version of [Semantic Versioning](https://semver.org) for all changes. [See this document](VERSIONS.md) for details.\n\n### Migrate from earlier versions\n\nSee the migration guide [here](./UPGRADE.md). Also, if you were using the `Twilio.Mvc` package, that has been replaced by the [Twilio.AspNet.Mvc][aspnet] package which is compatible with this version of the library.\n\n### TLS 1.2 Requirements\n\nNew accounts and subaccounts are now required to use TLS 1.2 when accessing the REST API. [\"Upgrade Required\" errors](https://www.twilio.com/docs/api/errors/20426) indicate that TLS 1.0/1.1 is being used. With .NET, you can enable TLS 1.2 using this setting:\n\n```csharp\nSystem.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;\n```\n\n### Supported .NET versions\n\nThis library supports .NET applications that utilize .NET6+.\n\n## Installation\n\nThe best and easiest way to add the Twilio libraries to your .NET project is to use the NuGet package manager.\n\n### With Visual Studio IDE\n\nFrom 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:\n\n```shell\nInstall-Package Twilio\n```\n\n### With .NET Core Command Line Tools\n\nIf you are building with the .NET Core command line tools, then you can run the following command from within your project directory:\n\n```shell\ndotnet add package Twilio\n```\n\n## Sample usage\n\nThe examples below show how to have your application initiate and outbound phone call and send an SMS message using the Twilio .NET helper library:\n\n```csharp\nTwilioClient.Init(\"ACCOUNT_SID\", \"AUTH_TOKEN\");\n\nvar call = CallResource.Create(\n    new PhoneNumber(\"+11234567890\"),\n    from: new PhoneNumber(\"+10987654321\"),\n    url: new Uri(\"https://my.twiml.here\")\n);\nConsole.WriteLine(call.Sid);\n\nvar message = MessageResource.Create(\n    new PhoneNumber(\"+11234567890\"),\n    from: new PhoneNumber(\"+10987654321\"),\n    body: \"Hello World!\"\n);\nConsole.WriteLine(message.Sid);\n```\n## OAuth Feature for Twilio APIs\nWe are introducing Client Credentials Flow-based OAuth 2.0 authentication. This feature is currently in beta and its implementation is subject to change.\n\nAPI examples [here](https://github.com/twilio/twilio-csharp/blob/main/examples/PublicOAuthAuthentication.md)\n\nOrganisation API examples [here](https://github.com/twilio/twilio-csharp/blob/main/examples/BearerTokenAuthentication.md)\n\n## Specify Region and/or Edge\n\nTo take advantage of Twilio's [Global Infrastructure](https://www.twilio.com/docs/global-infrastructure), specify the target Region and/or Edge for the client:\n\n```csharp\nTwilioClient.SetRegion(\"au1\");\nTwilioClient.SetEdge(\"sydney\");\n```\n\nThis will result in the `hostname` transforming from `api.twilio.com` to `api.sydney.au1.twilio.com`. Use appropriate client depending on the type of authentication used\n\n## Enable debug logging\n\nThere are two ways to enable debug logging in the default HTTP client. You can create an environment variable called `TWILIO_LOG_LEVEL` and set it to `debug` or you can set the LogLevel variable on the client as debug:\n\n```csharp\nTwilioClient.SetLogLevel(\"debug\");\n```\n\n## Handle exceptions\n\nFor an example on how to handle exceptions in this helper library, please see the [Twilio documentation](https://www.twilio.com/docs/libraries/csharp-dotnet/usage-guide#handle-errors).\n\n## Generate TwiML\n\nTo control phone calls, your application needs to output [TwiML][twiml].\n\n```csharp\n// TwiML classes can be created as standalone elements\nvar gather = new Gather(numDigits: 1, action: new Uri(\"hello-monkey-handle-key.cshtml\"), method: HttpMethod.Post)\n    .Say(\"To speak to a real monkey, press 1. Press 2 to record your own monkey howl. Press any other key to start over.\");\n\n// Attributes can be set directly on the object\ngather.Timeout = 100;\ngather.MaxSpeechTime = 200\n\n// Arbitrary attributes can be set by calling set/getOption\nvar dial = new Dial().SetOption(\"myAttribute\", 200)\n                     .SetOption(\"newAttribute\", false);\n\n// Or can be created and attached to a response directly using helper methods\nvar response = new VoiceResponse()\n    .Say(\"Hello Monkey\")\n    .Play(new Uri(\"http://demo.twilio.com/hellomonkey/monkey.mp3\"))\n    .Append(gather)\n    .Append(dial);\n\n// Serialize the TwiML objects to XML string\nConsole.WriteLine(response);\n\n/*\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cResponse\u003e\n  \u003cSay\u003eHello Monkey\u003c/Say\u003e\n  \u003cPlay\u003ehttp://demo.twilio.com/hellomonkey/monkey.mp3\u003c/Play\u003e\n  \u003cGather numDigits=\"1\" action=\"hello-monkey-handle-key.cshtml\" method=\"POST\" timeout=\"100\" maxSpeechTime=\"200\"\u003e\n    \u003cSay\u003eTo speak to a real monkey, press 1. Press 2 to record your own monkey howl. Press any other key to start over.\u003c/Say\u003e\n  \u003c/Gather\u003e\n  \u003cDial myAttribute=\"200\" newAttribute=\"false\"\u003e\u003c/Dial\u003e\n\u003c/Response\u003e\n*/\n```\n\n## Use a custom HTTP Client\n\nTo use a custom HTTP client with this helper library, please see the [advanced example of how to do so](./advanced-examples/custom-http-client.md).\n\n## Annotations\n\n### Beta\nFeatures marked with the `[Beta]` attribute are in a beta stage and may undergo changes in future releases. Use these features with caution as they may not be stable.\n\n### Deprecated\nFeatures marked with the `[Deprecated]` attribute are deprecated and are not encouraged to use\n\n### Preview\nFeatures marked with the `[Preview]` attribute are in a preview stage and are intended for evaluation purposes. They are subject to change and should not be used in production without thorough testing.\n\n## Docker Image\n\nThe `Dockerfile` present in this repository and its respective `twilio/twilio-csharp` Docker image are used by Twilio for testing purposes.\n\nYou could use the docker image for building and running tests:\n\n```bash\ndocker build -t twiliobuild .\n```\n\nBash:\n\n```bash\ndocker run -it --rm -v $(pwd):/twilio twiliobuild\nmake test\n```\n\nPowershell:\n\n```pwsh\ndocker run -it --rm -v ${PWD}:/twilio twiliobuild\nmake test\n```\n\n## Get support\n\nIf you need help installing or using the library, please check the [Twilio Support Help Center](https://support.twilio.com) first, and [file a support ticket](https://twilio.com/help/contact) if you don't find an answer to your question.\n\nIf you've instead found a bug in the library or would like new features added, go ahead and open issues or pull requests against this repo!\n\n[twilio]: https://www.twilio.com\n[apidocs]: https://www.twilio.com/docs/api\n[twiml]: https://www.twilio.com/docs/api/twiml\n[libdocs]: https://www.twilio.com/docs/libraries/reference/twilio-csharp/\n[aspnet]: https://github.com/twilio/twilio-aspnet\n","funding_links":[],"categories":["C# #","C\\#","SMS and Phone calls","短信和电话","Csharp","Identifiers"],"sub_categories":["GUI - other"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwilio%2Ftwilio-csharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwilio%2Ftwilio-csharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwilio%2Ftwilio-csharp/lists"}