Level up your Twilio API skills in TwilioQuest, an educational game for Mac, Windows, and Linux. Download Now
Build the future of communications.
Start building for free
  • By Layla Porter
    Test Driven AutoMapper with .NET Core VNcMVOXYfSc2DCoiaq5heVIF6fTmdIPVXG81WxYpM5QG06S-df8fuYYbNjgavC69zPz6U9afsp2RIjnxL0VA0T3M5TwyCqdIpmgXGStZp7NvzSP0utazOyORagpt1LutXk1m21bH

    If you use data in a project then you have most likely had to map one model to another.  Whether you've done that in the constructor, a dedicated method, or used a mapper of some sort, it can be repetitive and tedious.

    AutoMapper, a library for .NET written by Jimmy Bogard, has been around for a while.  It had a revamp to work with .NET Core and Dependency Injection but can still feel a little bit like magic.

    I use AutoMapper for an internal Twilio tool.  I struggled to create valid maps that work without requiring me to map everything manually.

    I found the best way to configure AutoMapper is by writing tests and lettingAutoMapper tell me exactly what I need to configure. Let me show you how that works.

    I have created a solution in this repository that has the AutoMapper NuGet package already installed and all …

    Read More
  • By Layla Porter
    Daily Dog with C#, WhatsApp and Azure functions 822m66DdV5S5TrfkutIagXi-tELxwMf92-KOdnf64XbhS8GoCdTYklLhMJiNKi4QTNCZ_nb50f7I9582qI1iZcOiiJ1yuOBIejZ5T5nNjn0QyoKQWY0v843XjJvxYPum-kQsq0Q7

    I love Bing Image of the day, it always makes me smile! I also love dogs, so I thought why not combine the two and create an app that sends a daily dog picture via WhatsApp.

    This post will take you through all the steps to create an azure scheduled function in C#, make a call to the Dog API to retrieve a photo and then send the returned image to a number via the Twilio API for WhatsApp.

    This post assumes some base knowledge of C# and RESTful APIs.

    To get started, we will need:

    Create an Azure Function

    From the Azure portal, click the Create a resource button, …

    Read More
  • By Layla Porter
    Receive an SMS and email it using Twilio SendGrid, C# and .NET Core vqwvGirMVXQf8bGStK4xKGF4vtzssY0VthK_xXQyITCdwJoMGJlN_2BxVqxkzasx2t5Vt9HV2T9WIdEDNZHh0a3EISjvwX5eDCwktAsPSJEPWJkQDmAEKDJ47FInZi_XlcaslMHr

    An apt business use for both Twilio SMS and Twilio Sendgrid would be for customer enquiries on a website.  Using C# and .NET Core 2.2 we will build an app that receives an SMS, takes the from number and the message body and send out an email using Twilio SendGrid.

    To get started with this project you will need the following:

    Creating the project

    We are going to use the WebApi template project that comes with the .NET Core SDK, as a starting point.

    From the command line, navigate to the location you wish to create the new application. Use the …

    Read More
  • By Layla Porter
    WhatsApp Media with C#, .NET Core and the Pho.to API hero.jpg

    When the WhatsApp API for Twilio launched last year it only supported text.

    Not anymore!

    The WhatsApp API for Twilio now supports media, including images and files.  

    So let's build an app that receives an image from WhatsApp, processes the image using one of the many options available on the Pho.to API and then returns the processed image.

    What we'll need to get started.

    Create a new folder for your project and navigate into it.

    >mkdir PhotoFiddler
    >cd PhotoFiddler
    

    Once in your new folder, we can make a new .NET Core WebAPI project using the command …

    Read More
  • By Layla Porter
    Send a WhatsApp media message with C# in 30 Seconds ioc5s81IAy6e0Cqe_VcjmBc5qfB-J1WSRBbtj0sS-A7CaslmfXu6fylG_YRsfJa0OelC0KBBZ2kFSmV32t-Wdl11UXbiGaYBnfYTwmBvIC2zCRWcC6ZBXj95mYFeWgVB5G_mSRzP

    When the Twilio API for WhatsApp was launched in Summer 2018 it could only handle text-based messages.  Now, the API can send and receive media 🎉. Sending a media message with WhatsApp is just as quick as sending a text message, here's how in just 30 seconds!

    To make this even quicker to get started, below is all the code and a link to the completed project on GitHub.

     

    To code along with this post, make sure the following are set up:

    After creating a new .NET Console application, add the Twilio NuGet package to the solution.  If unsure on how to do this, check out this post.

    Open the Program.cs file and …

    Read More
  • By Layla Porter
    Envíe un mensaje de WhatsApp con C# en 30 Segundos 6It5ZWs3UpkO1eqWwsHtO3tKxqjs6pPOlLtXi75dRmsCkgAy4P0qbX7EEvpxSOZK9j-aMT0-vU1mlThFzMouxLVk0usDwbQi2hkawlGnwP785uZbyqvNDGVFaR5TQljdH7OOW9vF

    Envíe un mensaje de WhatsApp con C# en 30 Segundos

    Ya hemos mostrado cómo agregar Mensajes SMS a su aplicación pero ahora, con la nueva API de Twilio para WhatsApp, puede enviar un mensaje de WhatsApp de la misma manera.

    Y rápidamente.

    Aquí hay un video de treinta segundos que muestra lo rápido que es.

    Y para hacer esto super fácil de empezar, a continuación se encuentra toda la  codificación y un enlace a  un proyecto terminado en GitHub.

    Lo que usted necesitará:

    Después de haber creado su nueva aplicación de consola .NET, añada el paquete Twilio NuGet a la solución. Si no está seguro de cómo hacer esto, …

    Read More
  • By Layla Porter
    Translator via SMS with C# and Azure Functions pwv8AtRTNvGi2RBhg7igAUDd3FSB0HEIhl-BVojY7M01jf8lcShxgnA5k237tZS5uIOc7NDkBm04IWmVtC4VwBG-qlNISJA2IdV31Qcy10HIG8TqXtv35FPjCTIzthyVcTfkwW8Q

    Ahoy and yo-ho-ho! In celebration o' International Talk Like A Pirate Day, let's build a SMS Pirate Speak translator with Azure Functions, the Fun Translations API and, of course, Twilio.

    What you’ll need:

    Azure Functions allow you to write code without having to worry about infrastructure or servers, so they are perfect for setting up a simple webhook for an incoming SMS or call from Twilio.

    Create an Azure Function

    From the Azure portal, click the Create a resource button, found at the top of the menu on the left.  Search for a Serverless Function App and then click on the matching result.

    Give your app a …

    Read More
  • By Layla Porter
    Send a WhatsApp message with C# in 30 Seconds 0ybbqiIjKQNoaBzTT_jSUOu8A1CTDBgzIZ4h0rudoYXMgb9tghVgTH5gmbzW1DRLL_mrVJz-USw_-ngI8pGsgTfmwRjq4PJjCIG_K0YOcH-efCVDcQvRw-0ARKuFDCRAGfoSbg7h

    We've already shown you how to add SMS messages to your application but now, with the new Twilio API for WhatsApp, you can send a WhatsApp message in much the same way.

    And quickly.

    Here's a thirty-second video showing you just how quickly.

    And just to make this super easy to get started, below is all the code and a link to the completed project on GitHub.

     

    What you'll need:

     

     

    After you have created your new .NET Console application, add the Twilio NuGet package to the solution.  If you are unsure how to do this, check out this post.

    Open the Program.cs file and add in the Twilio using …

    Read More
  • By Layla Porter
    Chuck Norris jokes via WhatsApp with C# and Azure Functions tqHx9wLhOJm_JUAx8gNphdspQHuf8DVyXIB-aIsNww4L5yQImyL5k2bB2qkOL9Bqf-VPq0Hfq74sGJSvBBQTjMnSkrVz0btT4vSCHQO4cZ6-vjviB7WINn-1WtLdDD_3tC0lVAuN

    Setting up a .NET application takes time and sometimes you just want to write a quick bit of code that sends you a Chuck Norris joke via the Twilio API for WhatsApp! So that’s what we’re going to do with the help of Azure Functions.

    What you’ll need:

    Azure Functions allow you to write code without having to worry about infrastructure or servers, so they are perfect for setting up a simple webhook for an incoming SMS or call from Twilio.

    Create an Azure Function

    From the Azure portal, click the Create a resource button, found at the top of the menu on the left.  Search …

    Read More
  • By Layla Porter
    Talking Texts with .NET Core, Cognitive Services and Azure Storage ZuVnzXGSF90QI4xjlHcGzwRlZeH6MZhHCbow_q8L4XsR7AU62P6kKNbvpE683kZoczLJMSVGZbKakcvkuDPH1BYz-KjFjJ3rJcIW0B3eMVAxwqgvHEzPVE_Ch7KY584CUzzmslUo

    Imagine you are driving along in your car and your phone beeps, letting you know that a text message has come in.  We all know it’s beyond dangerous to read a message whilst driving, it’s a pet hate of mine when I see people doing it, so why not get your text message phoned through to you? Hands-free, of course!

    This post will show you how to create talking texts using Twilio, .NET Core, Cognitive Services and Azure Storage.

    We will build an application that will convert incoming SMS into speech using the Speech Service, currently in preview, on Microsoft Cognitive Services.  We will then use Twilio to call your mobile and play the speech recording.

    Let’s get started.

    What you will need

    Read More
  • Newer
    Older
    Sign up and start building
    Not ready yet? Talk to an expert.