Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Migrating from twimlbin.com to Console Twimlbins


twimlbin.com was created in 2011 by developers in the Twilio community to rapidly prototype solutions like call forwarding or conference calls. twimlbin.com handled the hosting of TwiML, and allowed Voice and SMS apps to be created without the need to spin up a server. This was such a useful tool that twimlbin.com quickly became popular, powering almost 100 thousand Twilio phone numbers.

With the addition of TwiML Bins in the Console, we've made twimlbin.com functionality a native experience. Additionally, native TwiML Bins are hosted on Twilio's global cloud infrastructure and backed by our world-class security and cloud ops teams for dependable performance.

This guide covers the necessary steps in order to move your twimlbin.com functionality to the new TwiML Bins.

(warning)

Warning

Unlike twimlbin.com, any TwiML Bin inside the Console is bound to that specific account. If you are using the same TwiML Bin with multiple accounts or subaccounts, you'll have to replicate it to each account.

For example, when creating outbound Calls, set the URL of your account's TwiML Bin to the url property. Alternatively, you can pass the TwiML directly via the twiml property.


Getting started with TwiML Bins in the Twilio Console

getting-started-with-twiml-bins-in-the-twilio-console page anchor

Log in to the Twilio Console(link takes you to an external page) using your Twilio account credentials, and open the TwiML Bin(link takes you to an external page) section. If you haven't worked with TwiML Bins in the Console before, you will find a link to the TwiML Bin section on the Explore Products(link takes you to an external page) page under Developer Tools.

You will see the option to create a new TwiML Bin as well as a list of your existing TwiML Bins, if any.

Create a TwiML Bin page in the Twilio Console.

When you create a new TwiML Bin, you'll be presented with the ability to give it a friendly name and, of course, some TwiML that will define the behavior of your Voice or SMS application.

Example of creating a TwiML Bin and configuring its response and content.

Once you've created a new TwiML Bin, you can navigate to the Phone Numbers section and configure Twilio to run your TwiML when a phone call or SMS message comes in.

In the Voice or Messaging section of the active number page, you will see descriptions of the events that can be triggered during a call:

  1. A call/message comes in for this phone number.
  2. The primary handler for (1) fails.
  3. The status of the call has changed .
Use the Managing Phone Numbers UI to assign your TwiML Bin to handle incoming calls.

In addition to providing a webhook, a developer can now choose to handle incoming call and messaging events with a TwiML Bin. Select TwiML from the A Call/Message Comes In drop-down, and you will have the option to select a TwiML Bin to attach to the specified phone number. When the selected type of event comes in to this Twilio number, Twilio will execute the TwiML you've provided without the need for your own web server.


Migrating existing twimlbin.com content to TwiML Bins in the Twilio Console

migrating-existing-twimlbincom-content-to-twiml-bins-in-the-twilio-console page anchor

You likely are reading this guide because you have some TwiML being hosted by twimlbin.com that must be migrated to the Twilio Console. Follow the steps below to safely migrate your TwiML from twimlbin.com to TwiML Bins.

(error)

Danger

Twimlbin.com responds to any incoming request with your hosted TwiML, however, Console TwiML Bins must be called by Twilio itself (such as webhooks on Calls and SMS) or with an accompanying, valid X-Twilio-Signature header. Otherwise, they will return 401 instead of valid TwiML and could potentially break your application.

If you are invoking your existing Twimlbin.com content from outside of Twilio, we highly suggest creating publicly accessible Twilio Functions which return the same TwiML, instead.

First, determine all of your twimlbin.com content that must be migrated. This will be easiest if you already have records of all twimlbin.com URLs in use by your application. If there are no records to work with, you can:

  • Search your codebase for all references to twimlbin.com, this should generate a list of all URLs that will need to be migrated.
  • Refer to the configuration for all of your Twilio phone numbers, and the Webhook URL provided for each number that points to a twimlbin.com address.
(information)

Info

Your twimlbin.com TwiML will be accessible by visiting the specific URL for that TwiML, such as: http://twimlbin.com/external/f613ffcaaa685d9745886adc9504e29b(link takes you to an external page).

To view the TwiML itself, append /raw to the URL. For example: http://twimlbin.com/external/f613ffcaaa685d9745886adc9504e29b/raw(link takes you to an external page)

For each twimlbin.com URL, perform the following steps:

  1. Visit the URL with /raw appended to it. This will give you the raw TwiML response that your application expects from that URL.
  2. Create a new TwiML Bin as described in the Getting Started section.
  3. Give the TwiML Bin an appropriate Friendly Name .
  4. Paste the raw content from step 1 into the TwiML field of the new TwiML Bin.
  5. Save the new TwiML Bin, and copy its unique URL.

    Where to copy the URL of your TwiML Bin.
  6. Replace all instances of the original twimlbin.com URL from step 1 in your application code with the new TwiML Bin URL from step 5, if applicable. If the original URL was a Twilio webhook, be sure to assign the new TwiML Bin as the primary handler for incoming calls or messages for your phone number, depending on which event type it was already handling.

    Where to copy the URL of your TwiML Bin.

Rate this page: