Sorry, you need to enable JavaScript to visit this website.

You are here

Understanding Messaging API Callbacks - Part 1

BY Marcus Kennan 30 January 2018

The callback functionality of the messaging API is a great utility allowing you to track the delivery status of sent messages, and receive replies to your dedicated phone number without the need of making additional API calls.

In this first of 2-post series, I will walk through how to set up callbacks for your app and how to develop and test callback features without having a hosted endpoint.

Sample code in this blog post is taken from the Happy Chat demo app available on our GitHub and is written in node.js and Angular 5.

Using Postman

This blog post will refer to and use Postman quite frequently. If you’re already familiar with Postman or would prefer to use a different tool to make API calls, feel free to skip this bit, otherwise here’s a quick how-to on using Postman to send messages using the messaging API.

Let’s take the example of sending an SMS message. To do this we need to set a few things; the request type, the request URL, any request headers and finally the request payload. We can use Postman to do this easily.

Firstly, change the request type to POST by cliking the dropdown at the top of the screen. If this is a fresh tab, it will be set to GET by default. Then in the input field labelled Enter request URL we need to put the URL used for sending SMS messages using the messaging API:

Next, set the headers by clicking on headers. To send an SMS we need to supply our authorisation token, the content type and the accept parameters like so:


Now, we can click on body to set up the request body. The minimum information required by the messaging API is a phone number to send the message to and the content body of the message:


Finally, click on send to use Postman to send the SMS and the contents in the body field will be sent to the phone number specified in the to address!

This is a pretty quick run-down on how to use Postman for the purpose of following this blogpost, if you'd like more details on using Postman there are loads of resources online inluding their own official documentation. With that out of the way, lets get onto how to make the most of the messaging API using callbacks!

Setting up the receive message callback

When provisioning a number using the endpoint there are two optional request parameters you can provide: activeDays and notifyURL. Here, the notifyURL parameter will be the URL that the messaging API will send all received message data to. For example, your provisiong request payload may look something like this:

  "activeDays": "30",
  "notifyURL": ""

It may take up to a minute but now any messages sent from regular phone numbers to your provisioned number will be picked up by the messaging API and their contents will be directed to the URL you specified in the notifyURL parameter. Additionally, the value of the notifyURL can be changed at anytime by sending this request again with a different value set for the notifyURL parameter.

Received messages arrive at your notifyURL will look like this:


One immediate drawback of this is that we need somewhere to host our app in order to pick up this callback from the messaging API, which isn't always feasible while we're still developing. However, we can get around this by using request bin and Postman.

[UPDATE: Since this post was written, the site is no longer available. You can try alternatives such as or The post has been updated to point to the service.]

Lets run through a full example of this. First navigate to and set up a mock endpoint by clicking on the create button.


The URL you see on this page will be our notifyURL. Now, open Postman and send a the provisiong request with the request bin URL as our notifyURL

  "notifyURL": ""

Now in your browser navigate to the request bin URL and append ?inspect to the end. Using the URL here, that would be From this screen we can see any requests that are picked up here, including messaging we send back to our messaging API number.

Try sending an SMS message to a phone you'll be able to reply from using the messaging API and reply to it. Refresh the request bin page and you should see the message you replied with!


You can see the message ID of the retreived message, the senders phone number, a timestamp of when the message was sent and the message content. Pretty cool stuff, you can now provision a number with a mock URL and use request bin to confirm that it’s all working properly.

Stay tuned for part two of this post series where I will cover receiving and handling delivery notifications using the callback.

Thanks for reading and happy coding!

[Updated] Link to part 2 available here 

Related Blogs

iot home garden project with arduino and azure
anonymous's picture

By keith coutlemanis


  • arduino
  • azure

Azure IoT garden project with Arduino

In this blog, I'll showcase some of the interesting things you can do with the Internet of Thing...
anonymous's picture

By Trent Steenholdt


  • iot
  • azure

A home IoT project using Azure

In this blog series, I'll explan how I used the Internet of Things (IoT) to enable my gate, gara...
anonymous's picture

By Michelle Howie


  • messagingAPI
  • Tutorials

Get Started with the TelstraDev Messaging API

Have you ever wondered what an API is and why you should care? Have you ever had a mid-career cri...
anonymous's picture

By Christy Daguia


  • messagingAPI
  • replyRequest

Conversation via Telstra Messaging API

Creating a message thread can be done via Telstra Messaging API, whereby you can continue sending an...
anonymous's picture

By Rajeev Ramani


  • MMS
  • performance

Fine-tuning MMS performance on Telstra's Messaging API

  Here at TelstraDev, we strive to make the best possible developer experience, from the recen...
anonymous's picture

By Marcus Kennan


  • callbacks
  • Messaging SDK

Understanding Messaging API Callbacks - Part 2

Welcome to the second in a two part series on understanding the messaging API callbacks. In our firs...