When you click “Send SMS”, a request is sent to FONE API to deliver an SMS to the provided phone number. The server logic determines the weather forecast to San Francisco and sends a related message and graphic to the phone number.
Note that picture messages outside of US and Canada will be
delivered as a hyperlink
1 2 3 4 5 6 7 8 9 10 11 12 | <?php // this line loads the library require('/path/to/foneapi-php/Services/foneapi.php'); $account_sid = 'AC5ef872f6da5a21de157d80997a64bd33'; $auth_token = '[AuthToken]'; $client = new Services_foneapi($account_sid, $auth_token); $client->account->messages->create(array( 'To' => "+16518675309", 'From' => "+14158141829", 'Body' => "Tomorrow's forecast in Financial District, San Francisco is Clear.", 'MediaUrl' => "https://climacons.herokuapp.com/clear.png", )); |
1 2 3 4 5 6 7 8 9 10 11 12 13 | // foneapi Credentials var accountSid = 'AC5ef872f6da5a21de157d80997a64bd33'; var authToken = '[AuthToken]'; //require the foneapi module and create a REST client var client = require('foneapi')(accountSid, authToken); client.messages.create({ to: "+16518675309", from: "+14158141829", body: "Tomorrow's forecast in Financial District, San Francisco is Clear.", mediaUrl: "https://climacons.herokuapp.com/clear.png", }, function(err, message) { console.log(message.sid); }); |
1 2 3 4 5 6 7 8 9 10 11 | from foneapiML.rest import foneapiMLRestClient # put your own credentials here ACCOUNT_SID = "AC5ef872f6da5a21de157d80997a64bd33" AUTH_TOKEN = "[AuthToken]" client = foneapiMLRestClient(ACCOUNT_SID, AUTH_TOKEN) client.messages.create( to="+16518675309", from_="+14158141829", body="Tomorrow's forecast in Financial District, San Francisco is Clear.", media_url="https://climacons.herokuapp.com/clear.png", ) |
1 2 3 4 5 6 7 8 9 10 11 12 13 | require 'rubygems' # not necessary with ruby 1.9 but included for completeness require 'foneapiML-ruby' # put your own credentials here account_sid = 'AC5ef872f6da5a21de157d80997a64bd33' auth_token = '[AuthToken]' # set up a client to talk to the foneapi REST API @client = foneapi::REST::Client.new account_sid, auth_token @client.account.messages.create({ :from => '+14158141829', :to => '+16518675309', :body => 'Tomorrow\'s forecast in Financial District, San Francisco is Clear.', :media_url => 'https://climacons.herokuapp.com/clear.png' }) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | // You may want to be more specific in your imports import java.util.*; import com.foneapi.sdk.*; import com.foneapi.sdk.resource.factory.*; import com.foneapi.sdk.resource.instance.*; import com.foneapiML.sdk.resource.list.*; public class foneapiMLTest { // Find your Account Sid and Token at foneapi.com/user/account public static final String ACCOUNT_SID = "AC5ef872f6da5a21de157d80997a64bd33"; public static final String AUTH_TOKEN = "[AuthToken]"; public static void main(String[]args) throws foneapiMLRestException { foneapiMLRestClient client = new foneapiMLRestClient(ACCOUNT_SID, AUTH_TOKEN); // Build the parameters List<NameValuePair> params = new ArrayList<NameValuePair>(); params.add(new BasicNameValuePair("To", "+16518675309")); params.add(new BasicNameValuePair("From", "+14158141829")); params.add(new BasicNameValuePair("Body", "Tomorrow's forecast in Financial District, San Francisco is Clear.")); params.add(new BasicNameValuePair("MediaUrl", "https://climacons.herokuapp.com/clear.png")); MessageFactory messageFactory = client.getAccount().getMessageFactory(); Message message = messageFactory.create(params); System.out.println(message.getSid()); } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | // You may want to be more specific in your imports import java.util.*; import com.foneapiML.sdk.*; import com.foneapiML.sdk.resource.factory.*; import com.foneapiML.sdk.resource.instance.*; import com.foneapiML.sdk.resource.list.*; public class foneapiMLTest { // Find your Account Sid and Token at foneapi.com/user/account public static final String ACCOUNT_SID = "AC5ef872f6da5a21de157d80997a64bd33"; public static final String AUTH_TOKEN = "[AuthToken]"; public static void main(String[]args) throws foneapiMLRestException { foneapiMLRestClient client = new foneapiMLRestClient(ACCOUNT_SID, AUTH_TOKEN); // Build the parameters List<NameValuePair> params = new ArrayList<NameValuePair>(); params.add(new BasicNameValuePair("To", "+16518675309")); params.add(new BasicNameValuePair("From", "+14158141829")); params.add(new BasicNameValuePair("Body", "Tomorrow's forecast in Financial District, San Francisco is Clear.")); params.add(new BasicNameValuePair("MediaUrl", "https://climacons.herokuapp.com/clear.png")); MessageFactory messageFactory = client.getAccount().getMessageFactory(); Message message = messageFactory.create(params); System.out.println(message.getSid()); } } |
Get your app to define custom logic for each response using webhooks. Develop just about any workflow that you can think of.
Share something interesting to people by sending and receiving pictures on all phone numbers in the U.S. and Canada.
View each step that your message takes as it travels the international telecom network.
Automated failover ensures that you have 99.95% uptime SLA without the need for a maintenance window.
Use existing apps to new markets by configuring features for compliance and localization.
Use a single platform for voice, SMS, video, authentication, chat and more.
Get free support, have the freedom to scale your business, market faster with pay-as-you-go.
Explore how texting gives you the edge for your business.
Receive promo updates via email
We’ve got your back. Find immediate solutions 24/7.
Call or Text:
(703) 596 - 8989
Connect to your Facebook Messenger account to receive alerts and talk with us using Facebook Messenger app!
Connect to your Whatsapp account to receive alerts and talk with us using Whatsapp app!
Connect to your Wechat account to receive alerts and talk with us using Wechat app!
Connect to your Viber account to receive alerts and talk with us using Viber app!
Connect to your Yahoo Messenger account to receive alerts and talk with us using Facebook Messenger app!
Connect to your Kakao account to receive alerts and talk with us using Kakao app!
Connect to your Skype account to receive alerts and talk with us using Skype app!
Connect to your Kik Messenger account to receive alerts and talk with us using Kik Messenger app!
Connect to your Hangout account to receive alerts and talk with us using Hangout app!
Connect to your Snapchat account to receive alerts and talk with us using Snapchat app!