Twilio SMS Messaging Service

Lately, I have been getting messages about Twilio shutting down their old SMS service and I need to switch my code to use the Messaging Service by November of this year. Can someone help me modify my agent code to fix this?

function SendSMS(smsMsg) {
twilioSID ← “TWILIO SID”;
twilioToken ← “TWILIO TOKEN”;
twilioNumber ← “MY TWILIO NUMBER”;

twilio <- Twilio(twilioSID, twilioToken, twilioNumber);

recipientsNumber <- ["MY NUMBER"];
textMessage <- "Your mailbox has been " + smsMsg;

// Send the message synchronously
foreach (number in recipientsNumber) {
    local response = twilio.send(number, textMessage);
    server.log(response.statuscode + ": " + response.body);
}

}

There is a recently submitted change on the repo which I believe addresses this, but it’s not released yet. @smittytone might be able to help?

Yeah, that’s ready to go, but I can’t make it available via #require statements. @zandr ? @ahoughton ?

Meantime, @JerryW you can paste in the 2.0.0 code from the repo in place of the #require.

Thank you for the replies. Thank you for the revised code.

We’ll get the new library up and available via “#require” soon.

The updated library has been published. The file name has changed, so you’ll need to update the require statement to #require "Twilio.agent.lib.nut:2.0.0"

This topic was automatically closed after 60 days. New replies are no longer allowed.