![webook tutorial webook tutorial](https://i.ytimg.com/vi/zoTQQnFllbE/maxresdefault.jpg)
You can use different keys to access more data like issue labels etc. I read the docs and knew the keys for the JSON objects. This will be a standard endpoint that accepts POST requests. Now we need to create an endpoint to receive the request from the GitHub API. Create a simple Flask Serverįirst, let’s create a hello world endpoint. Let’s create an API to receive a request whenever a new Issue is created in a Github repo. This image was inspired by this articleĪs you might have noticed, a lot of requests are made and depending on how frequently we make requests, there might be a slight delay between the new issue being created and our API getting notified. Below is a comparison between polling and webhooks. Instead of us making periodic requests, we just give GitHub our API’s endpoint and whenever a new issue is created, a request will be made to the endpoint we gave to Github. What if GitHub makes a request to our API whenever a new issue is created.
![webook tutorial webook tutorial](https://siytek.com/wp-content/uploads/2020/03/image-117-1024x784.png)
Basically, we would have to periodically make requests to check for a new issue. One way would be to build an API that would make a request every 1-2 minutes to check if a new issue is made and notify us. If you want to learn more about working with APIs, check out my article on working with APIs with Python or my article on working with APIs with JavaScript.Ĭonsider the Github API, what if we wanted to build an API that would send use an email every time a new issue is made in a repo.
![webook tutorial webook tutorial](https://i.ytimg.com/vi/DVMuEVKMrRM/maxresdefault.jpg)
You make a GET/POST request to the API and you get a response back. What is a webhook?īefore talking about webhooks, let’s talk about APIs.
Webook tutorial how to#
We will also see how to expose our local hosts. We will also build a simple Flask server that can receive GitHub webhooks. This tutorial will be an introduction to the concept of webhooks.