You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/docs/product/integrations/integration-platform/webhooks.mdx
+16-6Lines changed: 16 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -12,13 +12,15 @@ We've built an [example application](https://github.com/getsentry/integration-pl
12
12
13
13
</Note>
14
14
15
-
Webhooks allow your service to receive requests about specific resources, depending on your selection, such as installation, issues, and alerts:
15
+
Webhooks are a way for two applications or services to communicate over the web, allowing one application to send automatic notifications or data updates to another in near real-time.
16
+
17
+
The concept is based on HTTP callbacks, where an HTTP POST request is sent to a specific URL (an HTTP endpoint in your tech stack) with a payload. Sentry uses JSON webhooks to get error notifications to your systems or services.
All webhooks will contain the following set of request headers:
23
+
Sentry webhooks support various functionalities and are made up of four integral HTTP headers described below:
22
24
23
25
```json
24
26
{
@@ -30,11 +32,11 @@ All webhooks will contain the following set of request headers:
30
32
}
31
33
```
32
34
33
-
The `Sentry-Hook-Resource` and `Sentry-Hook-Signature` are described below.
35
+
The `Content-Type` header identifies the media type of the payload as JSON format. The `Request-ID` header provides a unique identifier for tracking and debugging specific events.
34
36
35
37
### `Sentry-Hook-Resource`
36
38
37
-
This is the resource that triggered the action. The action will be in the payload. The possible resources are listed below:
39
+
This header lets you know which resource from the list below triggered an action:
38
40
39
41
-`installation`
40
42
-`event_alert`
@@ -45,9 +47,11 @@ This is the resource that triggered the action. The action will be in the payloa
45
47
46
48
### `Sentry-Hook-Signature`
47
49
48
-
A hash generated using your Client Secret and the request itself. Used to verify the authenticity of the request.
50
+
This header represents a cryptographic hash generated by your _Client Secret_. Its primary purpose is to make sure the request is authentic and comes from Sentry servers.
51
+
52
+
**Verifying the Signature**
49
53
50
-
#### Verifying the Signature
54
+
The below code snippet lets you validate the signature with the event payload.
51
55
52
56
```javascript
53
57
constcrypto=require("crypto");
@@ -139,3 +143,9 @@ All webhook requests have some common elements.
If you’d like to test webhook configuration and look at payloads before starting development, an HTTP catch-all service that provides a designated URL where you can receive HTTP payloads and inspect the JSON event payload can come in handy. After you’ve reviewed the relevant event payloads, you can begin development.
150
+
151
+
To make testing and debugging webhooks faster and easier, you can create local tunnels to get incoming webhook requests from Sentry to your local machine. There are various tools that let you pick a port or address (such as 3000 or 8080) to be tunneled, and then provide you with a temporary public URL that forwards requests to your local server.
0 commit comments