Login Register
Code2night
  • Home
  • Blog Archive
  • Tutorial
  • Interview Q&A
  • Languages
    • Angular
    • C
    • c#
    • C#
    • HTML/CSS
    • Java
    • JavaScript
    • Node.js
    • Python
    • React
    • Security
    • SQL Server
    • TypeScript
  • Post Blog
  • Tools
    • JSON Beautifier
    • HTML Beautifier
    • XML Beautifier
    • CSS Beautifier
    • JS Beautifier
    • PDF Editor
    • Word Counter
    • Base64 Encode/Decode
    • Diff Checker
    • JSON to CSV
    • Password Generator
    • SEO Analyzer
  1. Home
  2. Blog
  3. Get SMS Logs from Twillio in Asp.Net MVC

Get SMS Logs from Twillio in Asp.Net MVC

Date- Oct 17,2022

4582

Free Download Pay & Download
Twillio Twillio Logs

Twillio SMS Logs:-

In this article we will see how we can get twillio sent sms logs and get all the details of sent sms from twillio. So for that purpose we have to follow these steps :-

Installing the Twilio NuGet package

NuGet\Install-Package Twilio.AspNet.Mvc -Version 6.0.0

After installing the Twilio package, we are going to modify the web config with the account SID and the auth token found from the Twilio dashboard

  <appSettings>
    <add key="config:AccountSid" value="AC3936d9aqq2323fedbdddd0ecd6df37199" /> <!--Replace with your AccountSid-->
    <add key="config:AuthToken" value="52b86f79c19bsassasasas704110dddddc26" />  <!--Replace with your AuthToken-->
  </appSettings>

The next part of our application is the controller that will receive our requests. Let’s create the SmsController class within a Controllers folder:

using System;
using System.Configuration;
using System.Web.Mvc;
using Twilio;
using Twilio.Rest.Api.V2010.Account;

namespace TwillioMVC.Controllers
{
    public class SmsController : Controller
    {
        // GET: Sms
        public ActionResult Index()
        {
            string accountSid = Convert.ToString(ConfigurationManager.AppSettings["config:AccountSid"]);
            string authToken = Convert.ToString(ConfigurationManager.AppSettings["config:AuthToken"]);
            TwilioClient.Init(accountSid, authToken);
            var messages = MessageResource.Read().ToList();
            return View();
        }
         
   }
}

Now run the application and you will be able to see the sent messages as showed in the image below. You can use those as per your requirements

So, this is how we can get sms logs from twillio in Asp.Net MVC .

S
Shubham Batra
Programming author at Code2Night — sharing tutorials on ASP.NET, C#, and more.
View all posts →

Related Articles

Get Channel Videos using YouTube Data Api in Asp.Net
Apr 13, 2023
Excel Export in Asp.Net MVC using XlWorkbook
Jun 11, 2022
Download Files as Zip file in Asp.Net
May 21, 2023
Linkedin Sign In using LinkedinLogin Nuget package in Asp-Net MVC
Apr 14, 2023

Comments

Contents

More in ASP.NET MVC

  • Implement Stripe Payment Gateway In ASP.NET 58617 views
  • Jquery Full Calender Integrated With ASP.NET 39532 views
  • Microsoft Outlook Add Appointment and Get Appointment using … 27472 views
  • How to implement JWT Token Authentication and Validate JWT T… 25165 views
  • Payumoney Integration With Asp.Net MVC 23118 views
View all ASP.NET MVC posts →

Tags

AspNet C# programming AspNet MVC c programming AspNet Core C software development tutorial MVC memory management Paypal coding coding best practices data structures programming tutorial tutorials object oriented programming Slick Slider StripeNet
Free Download for Youtube Subscribers!

First click on Subscribe Now and then subscribe the channel and come back here.
Then Click on "Verify and Download" button for download link

Subscribe Now | 1760
Download
Support Us....!

Please Subscribe to support us

Thank you for Downloading....!

Please Subscribe to support us

Continue with Downloading
Be a Member
Join Us On Whatsapp
Code2Night

A community platform for sharing programming knowledge, tutorials, and blogs. Learn, write, and grow with developers worldwide.

Panipat, Haryana, India
info@code2night.com
Quick Links
  • Home
  • Blog Archive
  • Tutorials
  • About Us
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Guest Posts
  • SEO Analyzer
Free Dev Tools
  • JSON Beautifier
  • HTML Beautifier
  • CSS Beautifier
  • JS Beautifier
  • Password Generator
  • QR Code Generator
  • Hash Generator
  • Diff Checker
  • Base64 Encode/Decode
  • Word Counter
  • SEO Analyzer
By Language
  • Angular
  • C
  • c#
  • C#
  • HTML/CSS
  • Java
  • JavaScript
  • Node.js
  • Python
  • React
  • Security
  • SQL Server
  • TypeScript
© 2026 Code2Night. All Rights Reserved.
Made with for developers  |  Privacy  ·  Terms
Translate Page