Rate this Page

Programmable SMS

FoneAPI makes sending and receiving SMS easy. Find the documentation, sample code, and developer tools you need to build exactly what you want, fast. We’ll handle the complexity of mobile carrier and global regulations. Let’s get building.

Make your first message
1
When your phone number receieves an incoming message, FoneAPI will send HTTP reqeust to your server at/sms
2
Your app tells Fone API how to respond with a text message.
3
Fone API gets the instructions from your app and sends text message
TAKE THE NEXT STEP WITH FONEAPI SMS
Get Started

"Ahoy, World" is a few lines of code away. Choose your programming language and dive in. We’ve got helper libraries and Quickstarts to get you sending SMS and MMS in your web app, fast.

Ahoy, World!
Send your first message. Jump to a Quickstart in the language of your choice:

php
// Get the PHP helper library from https://twilio.com/docs/libraries/php require_once '/path/to/vendor/autoload.php' ; //  Loads the library use FoneAPI\Rest\Client ;

// Your Account Sid and Auth Token from foneapi.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" ;
$token = "your_auth_token" ;
$client = new Client($sid, $token);

// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page

$message = $client
   ->messages("MM800f449d0399ed014aae2bcc0cc2f2ec")
   ->fetch();

echo $message->body;

/**
* Download the Node helper library from
* twilio.com/docs/node/install
* These consts are your accountSid and authToken from
* /console
**/


const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
const authToken = 'your_auth_token'
const client = require('twilio')(accountSid, authToken)

client.messages('MM800f449d0399ed014aae2bcc0cc2f2ec')
 .fetch()
 .then(message => console.log(message.body))

# Download the Python helper library from twilio.com/docs/python/install from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

message = client.messages("MM800f449d0399ed014aae2bcc0cc2f2ec") \
               .fetch()
print(message.body.encode('utf-8'))

# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# Initialize Twilio Client
@client = Twilio::REST::Client.new(account_sid, auth_token)

# Get an object from its sid. If you do not have a sid,
# check out the list resource examples on this page

@message = @client.api.messages('MM800f449d0399ed014aae2bcc0cc2f2ec').fetch

puts @message.body

/// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once '/path/to/vendor/autoload.php' ; // Loads the library
use FoneAPI\Rest\Client ;

public class Example {

   // Find your Account Sid and Token at twilio.com/user/account
   public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
   public static final String AUTH_TOKEN = "your_auth_token";

   public static void main(String[] args) {
       Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

       // Get an object from its sid. If you do not have a sid,
       // check out the list resource examples on this page

       Message message = Message.fetcher("MM5ef8732a3c49700934481addd5ce1659").fetch();
       System.out.println(message.getBody());
   }
}

// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
require_once Example '/path/to/vendor/autoload.php' ; // Loads the library
use FoneAPI\Rest\Client ;
using Twilio.Rest.Api.V2010.Account;


class Example
{
   static void Main(string[] args)
   {
       // Find your Account Sid and Auth Token at twilio.com/console
       const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
       const string authToken = "your_auth_token";
       TwilioClient.Init(accountSid, authToken);

       var message = MessageResource.Fetch("MM800f449d0399ed014aae2bcc0cc2f2ec");

       Console.WriteLine(message.Body);
   }
}

Build your App

You’ve got an idea in mind. Let’s get it to production.

Pick the docs that are right for you. These guides, sample app tutorials, and API reference docs will get you across the deploy line, straight to HTTP 200 OK.

Guides
Step-by-step instructions for how to build common features:
Sample App Tutorials
Advanced Features

Give your app the power to be successful in the wild.These features will help you build for resiliency, scale traffic, fight fraud and expand internationally. Deploy with confidence.

FoneAPI Copilot tackles challenges before they make it to your error logs. Increase your message delivery rates, find the right phone number to pair with specific users, and scale your message volume.

ReLATED PRODUCTS

These tools solve problems before they pop up. Manage user notification preferences, auto-redact sensitive information, and keep your users'accounts secure

Notify
Notifications coordinated across multiple channels
Proxy
Phone number privacy for text and voice conversations
Two-Factor Authentication
Login security for online accounts and transactions