Skip to content

Commit f3e5448

Browse files
committed
updated readme
1 parent 9635255 commit f3e5448

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Example JSON object output from the node:
5858
"payload": {
5959
"type": "webhook",
6060
"meta": {
61+
"id": "xxxxx-xxxx-xxxx-ab1d-89a8b0505693",
6162
"bucked_id": "12302faf-43bd-43c4-ab1d-89a8b0505693",
6263
"bucket_name": "nodered",
6364
"input_id": "544a6fe8-83fe-4361-a264-0fd486e1665d",
@@ -80,6 +81,30 @@ Example JSON object output from the node:
8081
}
8182
```
8283

84+
### Sending responses back to the caller
85+
86+
First, ensure that your bucket's input is configured to return responses (by default for security reasons it will always return 200 status code and an empty body):
87+
88+
1. Go to your buckets page https://my.webhookrelay.com/buckets
89+
2. Go to the bucket details
90+
3. Click on input's settings
91+
4. From the dropdown select "Any output"
92+
93+
Now, to send back responses from the Node-RED back to Webhook Relay so it can respond to the caller, form a payload:
94+
95+
```javascript
96+
return {
97+
meta: msg.payload.meta, // this is original meta field from the payload (it's important to include it so we have the message ID)
98+
status: 200, // status code to return (200, 201, 400, etc)
99+
body: "any payload here (if you want to send JSON, just stringify it first)" // body
100+
headers: {
101+
someheader: ['somevalue']
102+
}
103+
};
104+
```
105+
106+
Then, send this payload back to the Webhook Relay node through its input.
107+
83108
## Alternative methods
84109

85110
You can also use Webhook Relay CLI. One way forwarding webhooks

0 commit comments

Comments
 (0)