Skip to content

Instantly share code, notes, and snippets.

@niraj-shah
Last active December 10, 2015 21:18
Show Gist options
  • Save niraj-shah/4493701 to your computer and use it in GitHub Desktop.
Save niraj-shah/4493701 to your computer and use it in GitHub Desktop.
Twilio API: Sending a Text Message
<?php
require 'Services/Twilio.php';
$sid = "aaabbbcccdddeeefffggg"; // Your Account SID from www.twilio.com/user/account
$token = "hhhiiijjjkkklllmmmnnnooo"; // Your Auth Token from www.twilio.com/user/account
$client = new Services_Twilio( $sid, $token );
$message = $client->account->sms_messages->create(
'+44xxx', // From a valid Twilio number
'+44yyy', // Text this number
"The message to send"
);
echo $message->sid;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment