Skip to content

Commit 4bef819

Browse files
authored
feat: adds test webhook destination support (#80)
Signed-off-by: nitish <[email protected]>
1 parent 89a808e commit 4bef819

File tree

6 files changed

+542
-265
lines changed

6 files changed

+542
-265
lines changed

.secrets.baseline

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "package-lock.json|^.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2025-07-31T11:23:27Z",
6+
"generated_at": "2025-09-04T10:57:40Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"
@@ -126,15 +126,15 @@
126126
"hashed_secret": "d4c3d66fd0c38547a3c7a4c6bdc29c36911bc030",
127127
"is_secret": false,
128128
"is_verified": false,
129-
"line_number": 1560,
129+
"line_number": 1601,
130130
"type": "Secret Keyword",
131131
"verified_result": null
132132
},
133133
{
134134
"hashed_secret": "3235b7f8d626cde63611d2e9ec43473f4e844c67",
135135
"is_secret": false,
136136
"is_verified": false,
137-
"line_number": 2775,
137+
"line_number": 2816,
138138
"type": "Base64 High Entropy String",
139139
"verified_result": null
140140
}
@@ -144,15 +144,15 @@
144144
"hashed_secret": "0cc20f91828bed53ddb6294968b7f9abd631a3ba",
145145
"is_secret": false,
146146
"is_verified": false,
147-
"line_number": 1509,
147+
"line_number": 1535,
148148
"type": "Secret Keyword",
149149
"verified_result": null
150150
},
151151
{
152152
"hashed_secret": "3235b7f8d626cde63611d2e9ec43473f4e844c67",
153153
"is_secret": false,
154154
"is_verified": false,
155-
"line_number": 3149,
155+
"line_number": 3175,
156156
"type": "Base64 High Entropy String",
157157
"verified_result": null
158158
}

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ SDK Methods to consume
149149
- [Get Metrics](#get-metrics)
150150
- [Send Notifications](#send-notifications)
151151

152-
153152
## Source
154153

155154
### Create Source
@@ -511,6 +510,7 @@ Currently, this functionality supports following destinations:
511510
4. Microsoft&reg; Teams
512511
5. IBM Cloud Code Engine
513512
6. IBM Cloud Object Storage
513+
7. Webhook
514514

515515
```js
516516
const testDestinationParams = {
@@ -530,6 +530,27 @@ Once the test is completed, you will be presented with the results. These result
530530
- **Response Code**: If test fails, then the response code sent from the end destination client is returned
531531
- **Response Message**: If test fails, then the response message sent from the end destination client is returned
532532

533+
In case of `webhook` destination test response also returns notification_id, the status of notification_id will represent the webhook test result. Follow below additional steps to get status result of webhook destination test
534+
535+
536+
```js
537+
const getNotificationsStatusParams = {
538+
instanceId,
539+
id: <notification-id>,
540+
};
541+
542+
try {
543+
const getNotificationsStatusResult = await eventNotificationsService.getNotificationsStatus(
544+
getNotificationsStatusParams
545+
);
546+
console.log(JSON.stringify(getNotificationsStatusResult.result, null, 2));
547+
} catch (err) {
548+
console.warn(err);
549+
}
550+
```
551+
552+
The response of `GetNotificationsStatus` will have success, failed or inprogress status. The Notification ID will be valid only for 1 minute to fetch the status of test. The status response as **success** will conclude successful test of webhook destination
553+
533554
### Custom Domain Name Verification
534555

535556
After creation of the custom email destination with your domain name, make sure its validated for the right ownership.

0 commit comments

Comments
 (0)