. . .

Twilio Modul


With this module you can send SMS to mobile devices using the Twilio-Service ( https://www.twilio.com ).


Setting up an Twilio-Account and phone numbers

To use this module, you first need to create your own Twilio-Account at https://www.twilio.com/ . The registration is for free. With your account, you receive an Account SID and an Auth Token which you need later on for the configuration of the module. Furthermore, you need to obtain a Twilio Phone Number to use the module. The reason for that is when a SMS is sent through a mobile network, a phone number of the origin always needs to be provided. If you are using an paid Twilio-account, you can register your own phone number as an origin. If you are using a free account, you have to buy such a phone number directly through Twilio. Inside your Twilio-profile, you can determine a Twilio Number through Phone Numbers > Manage Numbers > Active Numbers as shown in the image below.


If you are using an free account, you need to register each phone number you want to send SMS to through Twilio. Registered phone numbers are so called Verified Caller IDs. You can do this through Phone Numbers > Verified Caller IDs. A number you want to register receives an activation code to complete the verification-process. If you are using a paid account, this verification is not necessary and you can send messages to any phone number.


Configuration through ApiOmat

When Setting up the module, you need to provide the following configuration parameters:

  • Account SID: The Account SID from your Twilio Account

  • Auth Token: The Auth Token from your Twilio Account

  • Phone Number: The phone number you registered through Twilio as an "Active Number". It is entered as +[country-code][number_without_leading_0]. For example: +49123456789

Using the Module

There are four ways to send SMS using the module: Using the Data Editor, through the Apidocs, as well as via cURL or of course via our generated SDKs.

Data Editor

Access the Data Editor and create a new Sms-Instance. You need to provide the phone number you want to send the message to, as well as the message itself. If you are using a free account, the phone numbers you want to send messages to need to be registered as Verified Caller IDs through Twilio as mentioned above. If you are using a paid account, you can send messages to any phone numbers.

The body field is not mandatory, so when creating an SMS object in the Data Editor it gets sent as soon as it's created, without any text in the body. This might change in the future.


You can use any SDK to use the Twilio Module, but this example shows the Java SDK:

  1. Create a backend and add the Twilio-Module from the Module Market

  2. Download the Java SDK

  3. Import the SDK as described in the Java-Quickstart-Tutorial

  4. Send an SMS using this example code:Java

    // First: Create a User
    User user = new User( );
    user.setUserName( "testUser" );
    user.setPassword( "mySecretPassword" );
    // Configure Datastore with this user
    Datastore.configureWithCredentials( user );
    // Save the User
    user.loadMe( );
    catch ( Exception e )
    // if loadMe fails: create the user
    user.save( );
    // Now, create an SMS object
    Sms sms = new Sms( );
    sms.setToNr( "+123456789" );
    sms.setContent( "This is your SMS-message" );
    // and send the SMS!
    sms.save( );


  1. Access the Apidocs

  2. Go to /apps/{appName}/models/{moduleName}/{dataModelName}

  3. Post with the following data:

  • appName: <your_app_name>

  • moduleName: Twilio

  • dataModelName: Sms

  • body:

    { "@type": "Twilio$Sms", "toNr": "<the_nr_you_want_to_send_anvsms_to>", "content": "Test text sent with the apiOmat Twilio module"}