old_contents: import datetime
  import logging
  import json
  
  from flask import Flask, request
  
  
  app = Flask(__name__)
  logger = logging.getLogger(__name__)
  MYSTORE = []
  
  
  @app.route("/", methods=['GET', 'POST'])
  def hello():
      msg = 'Request keys: {}'.format(u', '.join(list(request.values.keys())))
      if request.method == 'POST':
          MYSTORE.append(msg)
      return u'<br>'.join(MYSTORE)
  
  if __name__ == "__main__":
      app.run(debug=True)
  
new_contents: import logging
  import json
  
  from flask import Flask, request
  
  
  app = Flask(__name__)
  logger = logging.getLogger(__name__)
  MYSTORE = []
  
  
  @app.route("/", methods=['GET', 'POST'])
  def hello():
      if request.method == 'POST':
          num_media = int(request.values.get('NumMedia', 0))
          data = {
              'phone_number': request.values.get('From'),
              'urls': [request.values.get('MediaUrl{}'.format(d)) for d in range(num_media)]
          }
          MYSTORE.append(data)
          return ''
      return json.dumps(MYSTORE)
  
  if __name__ == "__main__":
      app.run(debug=True)
  
subject: return JSON with phone number and list of media urls