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

"javascript" posts

  • By Phil Nash
    An introduction to the Web Contact Picker API An introduction to the Web Contact Picker API

    If you're building a mobile application and you need access to the user's contacts you wouldn't give it a second thought, but on the web this feature was missing. The Chrome team saw this gap and got to work on an API that makes users' contacts available to developers with the security and privacy expected on the web. That API is now available in Chrome 80 on Android M or later.

    In this post we will investigate the new Contact Picker API and put it to use it in a Twilio Client application to add contact selection for making browser phone calls.

    The Contact Picker API

    The Contact Picker API consists of the ContactsManager object, available as the contacts property on the navigator object. As it is only supported on Chrome on Android for now, the first thing we should concern ourselves with is checking for support. We can do …

    Read More
  • By Sam Agnew
    How to build a Conference line with Twilio Functions Copy of Language template - node2 (2).png

    Another conference call, another app, another PIN, another log-in. Joining conference calls shouldn’t take more than simply dialing a phone number. Lets walk through how you can quickly build a conference line anyone and everyone can use with Twilio Functions.

    Setting up a Twilio Function

    You’ll need to create a Twilio account if you don’t already have one. From the Twilio Functions page in your Twilio Console, create a new Function and select the “Blank” template as seen in this image:

    Create a Twilio Function

    Give your function a name and a path.

    Give your function a route

    Writing code to handle incoming calls

    Now replace the default code in the function with the following code for our app, and click save:

    exports.handler = funct …
    Read More
  • By Nathaniel Okenwa
    A Socially Distanced Mother’s Day Gift with WhatsApp and Cloudinary A Socially Distanced Mother's Day Gift with WhatsApp and Cloudinary

    It was Mother’s Day last weekend (For those of us in the UK*), and I’m going to be totally honest: I completely forgot! The worst part is that most of the shops were closed so I was not able to go out shopping for a personal gift. Now, I could have just headed online and ordered a generic gift. However, I wanted this gift to be more personalised, something to remind my mum of the amazing influence that she has had on my life and the lives of others. So I decided to crowdsource pictures and messages from my extended family and my mum’s friends to create a scrapbook full of memories and personal messages. Here’s how I did it:

    Step 1: Design an Overlay

    I wanted all the photos that were sent in to have an overlay that has the names of the people in the photo. A bit …

    Read More
  • By Sam Agnew
    How to build a Conference line with Twilio and Node.js Copy of Language template - node2 (1).png

    Another conference call, another app, another PIN, another log-in. Joining conference calls shouldn’t take more than simply dialing a phone number. Lets walk through how you can quickly build a conference line anyone and everyone can use with Node.js.

    Development Environment Setup

    Start by making sure you have the right software installed that you'll need to use for the rest of this post. You will need:

    Here is a good guide to follow in general if you are going to be doing more with Twilio and Node.js and have any more questions.

    To install these npm modules, navigate to the directory where you want this code to live and run the following command in your terminal to create an npm …

    Read More
  • By Sam Agnew
    5 Ways to Make HTTP Requests in Node.js using Async/Await Copy of Language template - node2.png

    Making HTTP requests is core functionality for modern languages and one of the first things many developers learn when acclimating to new environments. When it comes to Node.js there are a fair amount of solutions to this problem both built into the language and by the community. Let’s take a look at some of the most popular ones.

    A few years ago, I wrote a similar post on this topic. But now that async/await functionality is more pervasive and mainstream in JavaScript code, making network requests is more straightforward than ever. On top of that, Request, the previously most popular HTTP library for Node has been deprecated. So it's time for an updated guide!

    As in the other post, we’ll be using NASA’s Astronomy Picture of the Day API as the JSON API that we are interacting with in all of these examples because space is the coolest …

    Read More
  • By Al Kiramoto
    Quickly Enable Your Employees to Work from Home Using Twilio Programmable Voice Enable employees to work from h ome

    If your PBX solution does not natively allow for remote working and you need to act fast, this solution is for you. This tutorial shows you how to create a solution with Twilio Programmable Voice and softphone software that enables employees to work from their homes.

    Configure the Programmable Voice SIP Endpoint

    You can forward incoming calls to Twilio numbers registered to SIP endpoints, and use a free softphone as an endpoint while working from home, as shown below:

    Flow for how employees can work from home using Twilio

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

    • A Twilio account. Sign up for a free trial account and get a $10 credit.
    • A call-enabled Twilio Phone Number.
    • SIP endpoint (IP Phones (e.g. Obihai) or Softphones (e.g. Zoiper or X-Lite)).

    Create the application

    Go to twilio.com and sign up for a free account or log in to your existing account.

    If you don't currently own a Twilio …

    Read More
  • By Toby Allen
    Build Two-Way Email to SMS with SendGrid and Twilio Hello SMS SendGrid to Email Forward

    Lots of businesses want to be able to communicate over SMS to their customers but struggle to integrate with established processes like shared email inboxes. Do you share a phone with the team, or do you opt for an inflexible 3rd party Email to SMS gateway with strict routing rules?

    Now, with the power of Twilio SendGrid email and Twilio SMS, you can quickly set up your own two-way email to SMS forwarding solution.

    In this short tutorial, you'll learn how to route messages from a Twilio SMS capable number to a shared inbox and vice-versa. We will do this by sending inbound SMS messages to email using the SendGrid API. Conversely, we'll leverage SendGrid's Inbound Parse functionality to call the Twilio Messaging API. In both cases, we're going to use a small JavaScript function hosted in the Zeit Serverless environment. Zeit has been chosen for this because …

    Read More
  • By Dominik Kundel
    Three Things You Didn't Know You Could Do with npm Scripts Decorative image saying "Three things you didn't know you could do with npm scripts"

    The Node.js ecosystem is full with useful CLI tools and most of them offer configurations that let you tune them to do exactly what you want. However, sometimes you still have the need for very custom configurations and scripts. This is where "npm scripts" come into place. While you might have used this to set up your "build", "dev" or "start" script, there's a lot of things you can do with them. In this blog post we'll talk about the most useful and some hidden features.

    Before we get started, make sure you have the latest version of npm installed. While a lot of these things should work in yarn, berry and pnpm as well, we'll focus on npm in this article. Everything in this post has been tested with npm version 6.10.

    What are npm scripts?

    When we talk about "npm scripts" we are talking about entries in …

    Read More
  • By Jens Balmert
    Build Yourself as a Bot for Your Loved Ones Build Self with Autopilot

    We have all probably dreamed at some point of having a second version of ourselves – helping out on our behalf, being reachable at any time of the day…

    Wouldn’t it be great to have a bot with your voice, catchphrases, and laughter? It would make it possible for your loved ones to listen to you whenever they like, but it can also bring your customers’ bot experience to a whole new level.

    In this blog post, let’s build a bot with our own voice and connect it to one of our Twilio numbers, that it can be called any time – for example, by your partner when you’re not around.

    How your company can use Autopilot

    Twilio’s artificial intelligence platform, Autopilot, now supports playing audio files for conversational bot phone calls, as an addition to the existing text-to-speech.

    In your company, this feature can be used to completely change …

    Read More
  • By Matthew Gilliard
    Master Your Calendar with Twilio Studio and a Little Bit of Mathe-Magic Master your calendar with Twilio Studio and a little bit of Mathe-Magic

    We spend a lot of time sorting out future plans, and there are some people who seem to have their whole calendar in mind at a moment’s notice. Whether it’s planning to hang out with friends or setting up meetings with colleagues, you can acquire a mystical air by knowing a quick mathematical trick to calculate the day of the week for any date. With a little practice, you can do it in a matter of seconds while others are still fumbling their phones out of their pockets.

    In this post, I’ll explain the so-called Doomsday algorithm, and walk you through setting up an SMS chatbot for practising.

    The Doomsday Algorithm

    The Doomsday algorithm was invented by John Horton Conway as a way to work out what day of the week any date will fall on. Conway is better known as the inventor of the Game of Life but I …

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