Skip to content

Instantly share code, notes, and snippets.

@alsak0de
Created October 7, 2022 09:05
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/1415c42e7fb6521ab0ee0dac499b5ecc to your computer and use it in GitHub Desktop.
Save alsak0de/1415c42e7fb6521ab0ee0dac499b5ecc to your computer and use it in GitHub Desktop.
Sending a self whatsapp through WHIN API

This example flow leverages WHIN API service (hosted at RapidAPI) to send a simple hello world text message to yourself.

In order to use the flow, you need to be registered on the service. It won't work otherwise at ir requires one's rapidAPI user key.

The message format will be a JSON with the following basic structure:

{"text" : "Hello world"}

[
{
"id": "c2ecd9c5537b7e23",
"type": "inject",
"z": "e3a7b97ea7cac6ff",
"name": "",
"props": [
{
"p": "key",
"v": "<your_rapidapi_key>",
"vt": "str"
},
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "{\"text\":\"Hello\"}",
"payloadType": "json",
"x": 420,
"y": 440,
"wires": [
[
"830a8088d8b2ab06"
]
]
},
{
"id": "830a8088d8b2ab06",
"type": "function",
"z": "e3a7b97ea7cac6ff",
"name": "Whin2-Send",
"func": "msg.method = \"POST\";\nmsg.url = \"https://whin2.p.rapidapi.com/send\";\nmsg.headers = {\n 'content-type': 'application/json',\n 'X-RapidAPI-Host': \"whin2.p.rapidapi.com\",\n 'X-RapidAPI-Key': msg.key\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 610,
"y": 440,
"wires": [
[
"7b665da13ee54d70"
]
]
},
{
"id": "7b665da13ee54d70",
"type": "http request",
"z": "e3a7b97ea7cac6ff",
"name": "",
"method": "use",
"ret": "obj",
"paytoqs": "ignore",
"url": "",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"senderr": false,
"headers": [],
"x": 790,
"y": 440,
"wires": [
[
"719f37bdbd9a5779"
]
]
},
{
"id": "64d503062d9251ea",
"type": "debug",
"z": "e3a7b97ea7cac6ff",
"name": "debug 25",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1120,
"y": 440,
"wires": []
},
{
"id": "719f37bdbd9a5779",
"type": "function",
"z": "e3a7b97ea7cac6ff",
"name": "MSG",
"func": "msg.payload = msg.payload.msg;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 970,
"y": 440,
"wires": [
[
"64d503062d9251ea"
]
]
},
{
"id": "47f86b741dfef201",
"type": "comment",
"z": "e3a7b97ea7cac6ff",
"name": "Send",
"info": "",
"x": 370,
"y": 400,
"wires": []
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment