Very quick explanation:
An API is an interface that the maintainer of a service / module exposes to the outside world so that they can interact with said service / module.
So for instance, Reddit has an API, and you can request things like the list of comments on a specific post based on its unique ID.
The definition of a webhook is a little more broad because it’s used a little more liberally. Slack for instance used to call webhooks endpoints that you could hit to write messages (as yourself) in a specific slack room. This is, for all intent and purposes, just an API call.
Another use for the word is for instance a functionality offered by PagerDuty (an incident response provider, that send alerts to people when something goes wrong). In this case, a webhook is something you can configure to trigger API calls so that every time something happens (say any time someone resolves an incident in PagerDuty), PD makes an API call to the endpoint you provided them. This can be used to automatically update a status page on your website for instance. This effectively becomes a notification pipeline. You would need to write a service that is able to receive these API calls, and act on them.
Latest Answers