Skip to content

Instantly share code, notes, and snippets.

@alsak0de
Created October 7, 2022 10:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alsak0de/d0f27ba9f0918a7a9effa911ca461ac9 to your computer and use it in GitHub Desktop.
Save alsak0de/d0f27ba9f0918a7a9effa911ca461ac9 to your computer and use it in GitHub Desktop.
Enabling WHIN Receive (Whatsapp gateway) at rapidAPI

WHIN Receive service forwards the messages one sends to WHIN whatsapp number to Node-Red.

This is an extremely simple flow that hits WHIN receive target set endpoint at rapidAPI to enable WHIN Receive service.

[
{
"id": "5198e0808347554a",
"type": "inject",
"z": "e3a7b97ea7cac6ff",
"name": "",
"props": [
{
"p": "key",
"v": "<your_rapidapikey_goes_here>",
"vt": "str"
},
{
"p": "url",
"v": "http://my.endpoint.com/whin",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 390,
"y": 680,
"wires": [
[
"d26b5ca9e9ea9ccd"
]
]
},
{
"id": "d26b5ca9e9ea9ccd",
"type": "function",
"z": "e3a7b97ea7cac6ff",
"name": "Whin-Receive-Set-URL",
"func": "msg.method = \"POST\";\nmsg.url = \"https://whin2.p.rapidapi.com/addurl\";\nmsg.headers = {\n 'content-type': 'application/json',\n 'X-RapidAPI-Host': \"whin2.p.rapidapi.com\",\n 'X-RapidAPI-Key': msg.key\n}\nmsg.payload = {\"url\":msg.url}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 610,
"y": 680,
"wires": [
[
"acd43a2061497eee"
]
]
},
{
"id": "acd43a2061497eee",
"type": "http request",
"z": "e3a7b97ea7cac6ff",
"name": "",
"method": "use",
"ret": "txt",
"paytoqs": "ignore",
"url": "",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"senderr": false,
"headers": [],
"x": 850,
"y": 680,
"wires": [
[
"dd1c5ad90e9cd7bc"
]
]
},
{
"id": "dd1c5ad90e9cd7bc",
"type": "debug",
"z": "e3a7b97ea7cac6ff",
"name": "debug 26",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 1080,
"y": 680,
"wires": []
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment