<?php // Include the Twilio PHP library require "Services/Twilio.php"; // Set your AccountSid and AuthToken from www.twilio.com/user/account $AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; $AuthToken = "YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY"; // Instantiate a new Twilio Rest Client $client = new Services_Twilio($AccountSid, $AuthToken); // Make an array of people we know, to send them a message: $people = array( "+14158675309" => "Curious George", "+14158675310" => "Boots", "+14158675311" => "Virgil", ); // Loop over all our friends: foreach ($people as $number => $name) { $sms = $client->account->sms_messages->create( "YYY-YYY-YYYY", // Change the 'From' number to a Twilio number you've purchased $number, // the number we are sending to - Any phone number "Hey $name, Monkey Party at 6PM. Bring Bananas!" // the sms body ); echo "Sent message to $name"; // Display a confirmation message }
application: examplehelloworld version: 1 runtime: php api_version: 1 threadsafe: true handlers: - url: .* script: main.php
application: examplehelloworld version: 1 runtime: php api_version: 1 threadsafe: true handlers: - url: /images static_dir: images - url: /send-sms script: send-sms.php - url: /make-call script: make-call.php - url: .* script: index.php
<?php require 'Services/Twilio.php'; include 'credentials.php'; $client = new Services_Twilio($AccountSid, $AuthToken); $call = $client->account->calls->create( '1512-555-1212', // From this number '17035551212', // Send to this number 'http://twimlets.com/echo?Twiml=%3CResponse%3E%3CSay%3EHello%20Monkey!%3C%2FSay%3E%3C%2FResponse%3E&' ); print $call->sid;
<?php require 'Services/Twilio.php'; include 'credentials.php'; $client = new Services_Twilio($AccountSid, $AuthToken); $call = $client->account->sms_messages->create( '1512-555-1212', // From this number '17035551212', // Send to this number 'Hello monkey!!' ); print $call->sid;
Demonstrate your proficiency to design, build and manage solutions on Google Cloud Platform.