What is the difference between Webhooks and a REST API?

6

In API REST we define a resource to receive data and then return some response. And to send a message to a webhook , we make a request and also receive a response (depending on the case).

Do both do the same thing? So what's the difference? Is it only conceptual or implementation?

    
asked by anonymous 27.04.2017 / 05:14

2 answers

2

A Webhook is a service, API is the set of rules and methods with which we can communicate and use this service. There are webhooks that use a REST type API, others that use custom API, other GraphQL, Thrift, etc ...

Put another way:
Webhook is an online service, API is the way to interact with Webhook.

    
27.04.2017 / 08:14
2

What is a WebHook?

A WebHook is an HTTP endpoint that a client must implement to receive notifications of events that occur on a server.

Both do the same thing?

No. In a REST API, the server exposes a set of services through HTTP endpoints. In a WebHook, the client exposes an HTTP endpoint and subscribes to the server to receive event notifications.

So what's the difference?

The difference is that the client consumes the server's REST API directly through HTTP requests whereas WebHooks are HTTP requests that the client must wait for.

    
14.11.2018 / 19:32