Skip to content

Run locally

This tutorial assumes you've already completed the steps in the prerequisites section.

Run an existing application

Download source code

git clone

Install dependencies

We first need to go to the project directory and install the dependencies.

cd nodejs-onem-todo
npm install

Your directory should look like:

$ ls
api     config.js     package.json
app.js  node_modules  package-lock.json  static

Start the server

npm start

The above command will run the server locally at


If you try to access that link you will get a 403 error forbidden response, which is totally fine, since the server is looking into the HTTP headers for specific information sent by ONEm platform.

Expose the server publicly

Since our server is now running on your local interface, ONEm platform cannot reach it. But we can work around this by using ngrok.

Open a new terminal, go to the folder where your ngrok is and start it up on localhost port 8000.

./ngrok http 8000

The above command will start ngrok tool, which is basically creating a VPN tunnel so our webserver can be publicly reachable.

The output should be something like:

Session Status                online
Session Expires               7 hours, 59 minutes
Update                        update available (version 2.3.34, Ctrl-U to update)
Version                       2.3.30
Region                        United States (us)
Web Interface       
Forwarding           -> http://localhost:8000
Forwarding           -> http://localhost:8000


The last line says that a public URL ( has been generated for you, which forwards all the received requests to your computer's server (http://localhost:8000).


Copy the generated URL from your console as we will need it in the next step.

Register the application

To register your application open ONEm Developer Portal and register for a free account.

Once that is done, you will have an option to create an app. Hit that button and place the URL generated by ngrok as the callback URL.


That is it. We can now access the application by placing a hashtag in front of the name.

Run it

In the developer portal there is a Test Client section. This is a phone simulator from where you can test the app.

Head on to the test client and send #name-of-your-app. At this point ONEm will request the callback URL we've set previously, so if you check the ngrok logs you will see the request there.

HTTP Requests
GET /                          200 OK

In the test client you can see the below response:

A New todo
B Done(0)
--Reply A-B


The name of your app will be different, as chosen in the developer portal.

The above SMS response is rendered based on the HTTP JSON response returned by our / URL.

Tweak the application