Just try to receive a webhook in ngrok and python

tl;dr

Subject

flow

  1. Create a server that returns 200 OK no matter what you receive in Python
  2. Create an environment where you can receive access from the outside with ngrok
  3. Take a look at the contents of the webhook you received with the Inspect tool that comes with ngrok

Create a server that returns 200 OK no matter what you receive in Python


import http.server
import socketserver
import json

class MyHandler(http.server.BaseHTTPRequestHandler):
    def do_POST(self):
        self.send_response(200)
        self.end_headers()

with socketserver.TCPServer(("", 80), MyHandler) as httpd:
    httpd.serve_forever()
serving at port 80

Is displayed, it is OK.

Create an environment where you can receive access from the outside with ngrok

Guide

auth.bat


ngrok authtoken 1UFVG5sdtzGXXXXXXXXX

80listen.bat


ngrok http 80
ngrok

Take a look at the contents of the webhook you received with the Inspect tool that comes with ngrok

ngrok
inspect screen example

Recommended Posts

Just try to receive a webhook in ngrok and python
Try to calculate a statistical problem in Python
Try to make it using GUI and PyQt in Python
Try to calculate Trace in Python
Try to bring up a subwindow with PyQt5 and Python
Try to get a list of breaking news threads in Python.
Try logging in to qiita with Python
Try sending a SYN packet in Python
Check and receive Serial port in Python (Port check)
How to get a stacktrace in python
Try a functional programming pipe in Python
How to use is and == in Python
How to put a half-width space before letters and numbers in Python.
Connect to postgreSQL from Python and use stored procedures in a loop.
[Python] [Word] [python-docx] Try to create a template of a word sentence in Python using python-docx
How to stop a program in python until a specific date and time
First steps to try Google CloudVision in Python
Try to implement Oni Maitsuji Miserable in python
Organize python modules and packages in a mess
How to receive command line arguments in Python
3.14 π day, so try to output in Python
Try auto to automatically price Enums in Python 3.6
How to generate permutations in Python and C ++
To execute a Python enumerate function in JavaScript
How to embed a variable in a python string
Receive and display HTML form data in Python
I want to create a window in Python
How to create a JSON file in Python
Try to draw a life curve with python
I wrote a class in Python3 and Java
Try to make a "cryptanalysis" cipher with Python
Send messages to Skype and Chatwork in Python
Steps to develop a web application in Python
Try to calculate RPN in Python (for beginners)
To add a module to python put in Julialang
How to notify a Discord channel in Python
Try to make a dihedral group with Python
POST JSON in Python and receive it in PHP
Try using ChatWork API and Qiita API in Python
To represent date, time, time, and seconds in Python
How to plot autocorrelation and partial autocorrelation in python
Use libsixel to output Sixel in Python and output a Matplotlib graph to the terminal.
[Cloudian # 10] Try to generate a signed URL for object publishing in Python (boto3)
A complete guidebook to using pyenv, pip and python in an offline environment
WEB scraping with python and try to make a word cloud from reviews
Try gRPC in Python
Try 9 slices in Python
Convert timezoned date and time to Unixtime in Python2.7
Parse a JSON string written to a file in Python
How to convert / restore a string with [] in python
I want to embed a variable in a Python string
I want to easily implement a timeout in python
Receive the form in Python and do various things
Try creating a compressed file using Python and zlib
Receive dictionary data from a Python program in AppleScript
Try to improve your own intro quiz in Python
(Python) Try to develop a web application using Django
I want to write in Python! (2) Let's write a test
[Python] How to expand variables in a character string
Try to operate DB with Python and visualize with d3
Try searching for a million character profile in Python