Using a Messaging Service improves your customers' SMS or WhatsApp messaging experience with routing intelligence and content features that you can control from the Twilio Console. With Messaging Service features, you can localize outgoing phone numbers, distribute bulk text messaging across multiple senders, lock one number to a customer, and much more. A default Messaging Service is automatically generated for your Account upon creation.
This guide covers what a Messaging Service can do for your business and shows you how to set up a Service to send messages in your application.
To run any of the code samples found here, you can run the code samples in your local development environment, use the Twilio CLI, or use curl
commands in your terminal.
For instructions on setting up your local environment select your programming language of choice below:
Let's get started!
Sending messages at a high volume and/or at a global scale quickly balloons in complexity. That's why Twilio Programmable Messaging encourages the use of Messaging Services to manage your senders, maintain compliance with local carrier regulations, and create a smooth and consistent messaging experience for your end users.
Some Messaging Service features include:
From
phone number to message a given customer for a consistent experience
For more information, check out the Messaging Service Overview page.
An auto-generated default Messaging Service has been created for you, or you can create a Messaging Service through the Twilio Console or using the REST API with the following code:
Take note of the Messaging Service SID (a string starting with MGXX
) that the code prints to your console: you need this SID in future steps in this guide.
Sending SMS messages requires an SMS capable phone number. You can search for and purchase available phone numbers in the Console. When you search, make sure that the number you choose is SMS capable. Check the appropriate box in the search UI to filter available numbers to those that are SMS capable.