Get SMS Logs from Twillio in Asp.Net MVC | Code2night.com
Code2night
  • Home
  • Blogs
  • Guest Posts
  • Tutorial
  • Post Blog
  • Register
  • Login
  1. Home
  2. Blogpost

Get SMS Logs from Twillio in Asp.Net MVC

Date- Oct 17,2022

2741

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 .

Comments

Tags

LinkedinLogin
LinkedinProfile
GetLinkedinProfile
C#
Aspnet
MVC
Linkedin
ITextSharp
Export to Pdf
AspNet Core
AspNet
View to Pdf in Aspnet
Model Validation In ASPNET Core MVC 60
Model Validation
Model Validation In ASPNET Core MVC
Model Validation In ASPNET
Image Compression in AspNet
Compress Image in c#
AspNet MVC
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 | 1190
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 Join Us On Facebook

Welcome To Code2night, A common place for sharing your programming knowledge,Blogs and Videos

  • Panipat
  • info@Code2night.com

Links

  • Home
  • Blogs
  • Tutorial
  • Post Blog

Popular Tags

Copyright © 2025 by Code2night. All Rights Reserved

  • Home
  • Blog
  • Login
  • SignUp
  • Contact
  • Terms & Conditions
  • Refund Policy
  • About Us
  • Privacy Policy
  • Json Beautifier
  • Guest Posts