Message status

In this building block you will see how to receive message status updates.

Example

Ensure that your message status webhook is set in the Dashboard.

Prerequisites

Create an application

Write the code

Add the following to app.py:

Copy to Clipboard
#!/usr/bin/env python3
from flask import Flask, request, jsonify
from pprint import pprint

app = Flask(__name__)

@app.route("/webhooks/message-status", methods=['POST'])
def message_status():
    data = request.get_json()
    pprint(data)
    return "200"

if __name__ == '__main__':
    app.run(host="www.example.org", port=3000)

View full source 

Run your code

Save this file to your machine and run it:

$ python3 app.py

Try it out

The webhook will be invoked on changing message status and details printed to the console.