Skip to main content

Bring It All Together

Now, that you have created an endpoint with a callback-handling application and configured a callback either through the Portal or programmatically, you can test how the callback works.

From your mobile phone, send the word HELP to your number rented from CarrierX. Here's what happens afterwards:

HELP
  1. CarrierX receives the message and makes a callback with the inbound message JSON data, to your callback URL.
  2. The python application you have configured and hosted at the callback URL
    • parses the JSON data of the callback by checking that

      • the initial message direction was inbound
      • the message contained the help keyword
    • sends the preformatted HELP_RESPONSE back to your mobile number from the CarrierX number to which you sent HELP:

      Sample Company
      Contact customer support at 800-555-1212
      Text STOP to stop all messages
      Msg&Data rates may apply

      The help response contains three required elements: the company name, an email or a phone number and information on how to opt out of receiving further messages.

Now, CarrierX is sending the message to the mobile carrier and will start to report back as the message passes stages of delivery.

  1. CarrierX makes another callback, telling your application that the outbound message has been sent.
  2. Finally, upon the message delivery to the mobile phone, CarrierX makes the last callback with a status of delivered.

The following flowchart demonstrates the whole process in detail.

Callbacks for inbound and outbound messages