Skip to content

Commit 9d2adbc

Browse files
committed
Update documentation of webhook guide'
1 parent fed676a commit 9d2adbc

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/webhook_guide.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,24 @@ curl -X POST http://localhost:3010/webhooks \
145145
-d '{"id": "msg123", "status": "delivered", "deliveredAt": "2024-11-30T12:00:00Z"}'
146146
```
147147

148+
For example,
149+
150+
```bash
151+
secret="mySecret"
152+
payload='{"id": "msg123", "status": "delivered", "deliveredAt": "2024-11-30T12:00:00Z"}'
153+
signature=$(echo -n $payload | openssl dgst -sha256 -hmac $secret | awk '{print $2}')
154+
155+
curl -X POST http://localhost:3010/webhooks \
156+
-H "Authorization: Bearer $signature" \
157+
-H "Content-Type: application/json" \
158+
-d "$payload"
159+
```
160+
161+
The response should be look like this,
162+
163+
```
164+
{"message":"Webhook processed successfully."}
165+
```
148166

149167
### Unit Tests
150168

0 commit comments

Comments
 (0)