RingCentral SMS app

I wanted to learn how to receive an SMS using Ring Central’s API and write about my experience, I thought of how a simple idea of communication between integrations can benefit any person in numerous ways.

I had many ideas on my mind and I will probably be using them in the future, for example: Receive an SMS when a security camera in my house is activated by motion or sound by my curious golden retriever Floki, or a SMS when a door sensor is activated, when a light turns on inside the house, or maybe even get a SMS when someone pushes code to a repository.

Floki don’t be sad, I will be back in a few hours.

For the SMS API example I wanted to test something simple and that could be very productive, that is why I chose to integrate SMS Ring Central’s API with Formstack.

Formstack is a workplace productivity solution built to transform the way people collect information and put it to work, so what If I could use a Formstack form to collect data and depending on the submit response I got from a user, I could trigger an SMS using Ring Central’s API?

Ingredients needed :


1 Create a simple form in Formstack.

For this example I only used a Name and a Rating field.

Need help creating a form…

2 Install and run temporarily ngrok

Download the package and unzip it, then run:
./ngrok http 8080 (or any other port you would like to use)

It should look something like this:

Need more help using Ngrok:

We are now ready to tunnel:

3 Back in Formstack:

Go to Settings -> Emails & Actions and let’s supercharge this form by adding a Webhook, copy the ngrok forwarding IP to the Webhook URL, select Post with sub-field names and Post with API-friendly keys.

Need more help on webhooks:

4 Run a temp PHP web server

For this test, I created a folder named RingCentral, and added a php file named index.php

Inside that folder I ran the following command to start my php web server:

php -S localhost:8080

Sample content of the file:

echo 'hello Blog API Test';

We can make a quick test, to make sure we communicate with our localhost when submitting a form, so go ahead and submit your test form.

You can check the request data sent in

As you can see, I got my 5 star response value from the Rating field did_you_like_this_blog_tutorial and the name field with value Test1, and we can also see that my local web server responded with hello Blog API Test.

5 Setup RingCentral SMS API

And now for the most interesting part, we can now use the data submitted by the Formstack form that was sent to the localhost through ngrok and send a SMS with RIngCentral’s API.

First we need a developer account for Ring Central’s API, you should be able to create an account here: https://developers.ringcentral.com/

Once you have created an account simply create an SMP APP with one click:

Don’t have the link?
Don’t worry here it is:

Now that your sandbox app is created we need to download the PHP SDK to get started: (Make sure to download to the same directory where you started your php web server and where the file index.php is located.

$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar require ringcentral/ringcentral-php

Now simply edit the index.php file we created earlier and enter this code:



$RINGCENTRAL_SERVER = 'https://platform.devtest.ringcentral.com';



$platform = $rcsdk->platform();

$resp = $platform->post('/account/~/extension/~/sms',
       'from' => array ('phoneNumber' => $RINGCENTRAL_USERNAME),
       'to' => array(array('phoneNumber' => $RECIPIENT)),
       'text' => 'Hello World from PHP'
print_r ("SMS sent. Message status: " . $resp->json()->messageStatus);

Submit another form, check the request at:

And you should see a response like this one:

And immediately receive an sms that says:

Now to integrate everything together, just add this to the code before your credentials:

$find      = ['first =','last ='];
$name      = str_replace($find,'',$_REQUEST['name']);
$stars     = $_REQUEST['did_you_like_this_blog_tutorial'];
$message   = 'You received '. $stars . ' stars from'. $name;

And replace the $resp array text value to: $message

$resp = $platform->post('/account/~/extension/~/sms',
        'from' => array ('phoneNumber' => $RINGCENTRAL_USERNAME),
        'to'   => array(array('phoneNumber' => $RECIPIENT)),
        'text' => $message
Looks like someone rated me with 5 stars!

And that is it for now. I hope you enjoyed learning how to integrate Formstack, ngrok and RingCentral’s SMS API, because I sured did.