Kleist47 / getting-started-github-apps

https://lab.github.com/githubtraining/getting-started-with-github-apps
0 stars 0 forks source link

Update config.yml #4

Closed Kleist47 closed 5 years ago

request-info[bot] commented 5 years ago

We would appreciate it if you could provide us with more info about this issue/pr!

github-learning-lab[bot] commented 5 years ago

Nice job!

In the last pull request, we learned about webhooks and how the WIP and Request Info apps only respond to specific events. Webhooks allow you to build or set up GitHub Apps which subscribe to certain events on GitHub. When one of those events is triggered, an HTTP POST payload response is sent to the webhook's configured URL. We saw this with our smee.io webhook.

But webhooks are only one side to this story. To see the other side, meet API endpoints. :wave:

API endpoints

API stands for Application Programming Interface. APIs are used to share data or functionality. This is done by making an HTTP request to an API using an endpoint, and then receiving a reponse back.

For example, this is the endpoint to create a new pull request; POST /repos/:owner/:repo/pulls

When an event is triggered, the vastly more detailed GitHub API gives the bot an excessive amount of information (as a payload). The bot takes this payload, alters it slightly, and hands it back to GitHub's API, which delivers the change back to your repository.

Step 9: Learn more about the GitHub API

:keyboard: Activity: Discovering endpoints

  1. Navigate to this list
  2. Find the endpoint that an app would use to create a label
  3. Post that endpoint as a comment

After you comment, look for my response below

Kleist47 commented 5 years ago

application/vnd.github.machine-man-preview+json

github-learning-lab[bot] commented 5 years ago

Nice try! The label creation endpoint, found here, looks like this: POST /repos/:owner/:repo/labels.

APIs and Webhooks

APIs and Webhooks go hand in hand, but the distinction between them is important.

Step 10: See your changes in action

Now that you've made the change to your config.yml file, try to trigger that event to see the changes as a user.

:keyboard: Activity: Test out your original changes to the config.yml

  1. Go open a blank issue to see if the changes you made in your config.yml took effect!