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
    Using SQL Server on macOS with Docker Using SQL Server on macOS with Docker

    Since the release of .NET Core 1.0 in 2014, .NET developers have no longer been confined to development on Windows. Yet I am still surprised by how many people don't realise that .NET Core is cross-platform!

    I develop all my .NET code, from web apps to Azure Functions, on macOS and with SQL server being a large part of developing with .NET, I wanted to share how I use it on macOS.

    We will use a Docker container to host SQL server, which means this technique could also be used on Windows and Linux and not just macOS.

    Getting Started with Docker

    To get started we will need to download Docker for Mac and follow the installation instructions.

    Once installed, the first thing we will need to do is increase Docker's default memory allocation as SQL Server will require a bit more grunt.

    Click on the Docker daemon icon in …

    Read More
  • By Layla Porter
    Dependency Injection in Azure Functions with C# Title image: Dependency Injection in Azure Functions with C#

    One of my favourite features of Azure Functions v2 and above is the ability to include a Startup class. Why is this cool you may ask? Well, it means that you can use .NET Core's built-in Dependency Injection (DI). This then means that project architecture can look remarkably like ASP.NET Core web apps. DI also makes testing easier as dependencies can be mocked. In this post, I'll show you how you can quickly add DI to an Azure Function.

    Note: Azure Functions v3.0 became GA in January 2020. This means that you can now use .NET 3.1 and Node 12 in your Azure Functions. They still don't support the newSystem.Text.Json but that should come in time.

    Adding a Startup class to an Azure Function

    Start with an existing Azure Function project or create a new project from the CLI/IDE. You can choose any type of Function but for …

    Read More
  • By Layla Porter
    Get off the naughty list with Twilio Autopilot, Azure Functions and Table Storage Get off the naughty list header

    This blog post is part of The Third Annual C# Advent by Matthew Groves which is a C# advent calendar.

    Do you worry you're stuck on the naughty list? Have you forgotten all the good deeds and awesome things you've done over the past year to deserve more than a sack of coal?

    Tracking your little wins as they happen is a fantastic way to remember your successes whether you're sharing the list with your boss or Santa Claus or just yourself!

    We will use Twilio Autopilot to capture your accomplishments, thus enabling you to keep a log via SMS, voice, WhatsApp, Slack or even your Amazon Alexa or Google Home device!

    We're going to save the output of Autopilot to Azure Table Storage via an Azure Function.

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

    To get started, we will need:

    Read More
  • By Layla Porter
    Rainy with a chance of Azure Cloud Rainy with a chance of cloud

    We all have good days and bad days. On a good day, we may be filled with positive thoughts and on a bad day, we may forget that anything was ever positive!

    gif of cartoon animal crying in the rain

    In this post, we will use Twilio to text your positive thoughts and affirmations to an Azure Function and save them in Azure Table Storage. We will then create a timer-based function that will send a random happy thought from the table storage via SMS to your friends.

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

    To get started, we will need:

    Read More
  • 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
    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
    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
    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
  • Newer
    Sign up and start building
    Not ready yet? Talk to an expert.