Integrating Twilio For SMS

    Magentrix allows for integration with Twilio in order to send SMS messages. To configure it complete the following steps:

    1. Login as an Administrator, then navigate to Setup > Extend > Connected Apps.

    2. Click New to create a new Connected App. In the configuration wizard set the following:

      1. Integration Type "API Provider"

      2. Authentication Type “Basic”

      3. Authorization Information:

        • Name: Twilio
        • Service URL: https://api.twilio.com/
        • Username: <your Twilio Account SID>
        • Password: <your Twilio Auth Token>
        • Security Token: <your Active Phone Number>
      4. Click Save.

    Note: You may obtain the account API credentials in your Twilio account General Settings. The phone number can be found in the Active Numbers. You may need to create a number. The security token formatting is very strict, so you must use the exact format Twilio provides.

    Example:

    +16465550000
    

    Once the Connected App is configured you can call these methods in your code as provided below.

    Messaging.Twilio twilio = new Messaging.Twilio("Twilio");
    //Twilio is the name of the Connected App you have created
    var response = twilio.SendSMS("to phone", "your message");
    OR
    var response = twilio.SendSMS("from phone", "to phone", "your message");
    OR
    var response = twilio.SendSMS(new { From="", To:"", Body="your message"  });

    For more information, see Twilio's documentation.

    « Previous ArticleNext Article »


    3.0 (10)


    Comments

    No records to display

    Subscription
    Follow Knowledge posts
    Please enter your email address to subscribe:

    Email:
    Subscribe
    Follow us on Twitter