It appears that Twilio now requires me to have a 'Message Service' in programmable messaging to send.
The Twilio API service now has 'messagingServiceSid' tag that seems to be required (which you get by creating a 'Messaging Service' under programmable messaging - here is the code from Twilio which I have tested and it works:
// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once '/path/to/vendor/autoload.php';
use Twilio\Rest\Client;
$sid = "TWILIO ACCOUNT API KEY HERE";
$token = "[AuthToken]";
$twilio = new Client($sid, $token);
$message = $twilio->messages
->create("+PHONE_NUMBER_HERE", // to
array(
"messagingServiceSid" => "MESSAGING_SERVICE_SID_HERE",
"body" => "This is a test"
)
);
print($message->sid);
What would be AMAZING would be if Vodia was updated to allow a seperate MessagingServiceID per domain!
I have been able to test this using my own PHP code, and it would be a very simple way for Twilio users to be able to separate out their services for reporting.
From what I can see (and I may be wrong):
PBX Settings need: Twilio API Key and Twilio API Secret
Domain Settings need: Twilio Messaging Service ID
When sending the SMS request to Twilio, Vodia pulls the API information from the PBX, and the service id from the domain - in Twilio, all the SMS's sent are seperated into their service IDs, allowing for me to charge for them accordingly.