GithubHelp home page GithubHelp logo

telecmi / piopiy_example_python Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1 KB

PIOPIY Webhook implementation example in python

Home Page: https://doc.telecmi.com/piopiy/docs/webhooks-overview

Python 100.00%

piopiy_example_python's Introduction

PIOPIY Webhook Python

PIOPIY webhooks implementation in python. Use our simple python web server to test your webhooks and live events locally for development purpose.

Install

Follow the below installation instructions

Prerequisites

Prerequisites for python web server.

  • git (>= 2.20.1 required)
  • python (>= 2.7.16 required)
  • pip (>= 18.1 required)

Clone the repository

Use command git clone to clone the python webserver from our PIOPIY github repository.

git clone https://github.com/telecmi/piopiy_example_python.git

Change the directory to your project directory

cd piopiy_example_python

Install flask package using pip

Use command pip to install the flask(lightweight web application framework).

pip install flask # shows the tagged versions

Run

Run your python server using the below command

python webhooks.py

Now you can able to test our webhooks and live events, from your local server. To expose your local web server to the internet use ngrok.

You can create a secure HTTP tunnel by providing the port number on which your web server is running. For example, your web server is running on port number 5000. you can launch your HTTP tunnel with the following command line.

./ngrok http 5000

After exposing your local webserver to the internet using ngrok you will get the following output.

ngrok by @inconshreveable                                       (Ctrl+C to quit)
                                                                                
Session Status                online                                            
Session Expires               7 hours, 59 minutes                               
Update                        update available (version 2.3.35, Ctrl-U to update
Version                       2.3.34                                            
Region                        United States (us)                                
Web Interface                 http://127.0.0.1:4040                             
Forwarding                    http://c654b286.ngrok.io -> http://localhost:5000 
Forwarding                    https://c654b286.ngrok.io -> http://localhost:5000
                                                                                
Connections                   ttl     opn     rt1     rt5     p50     p90       
                              0       0       0.00    0.00    0.00    0.00  

Now you can get your dynamic URL from the above output. To configure webhooks and live events, paste your dynamic URL with correct path in webhooks section.

Sample URL with path

http://c654b286.ngrok.io/webhook/cdr

piopiy_example_python's People

Contributors

prasathsekar avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.