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":[]}]

Flow Info

Created 1 year, 8 months ago
Rating: 5 1

Owner

Actions

Rate:

Node Types

Core
  • comment (x1)
  • debug (x1)
  • function (x2)
  • http request (x1)
  • inject (x1)

Tags

Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option