Non-Media Messages
Messages without medias.
Read the details of how to use it in Requests.
There's a lib for nodejs here: Click here
- Send a simple text!
{ "connectionId": "YOUR_CONNECTION_ID", "method": "sendMessage", "params": [ "[email protected]", { "text": "Hi! This was sent using Whats2API" } ] }
- send a reply message!
{ "connectionId": "YOUR_CONNECTION_ID", "method": "sendMessage", "params": [ "[email protected]", { "text": "Hi! This was sent using Whats2API" }, { "quoted": "MESSAGE_OBJECT_TO_BE_QUOTED" } ] }
- send a mentions message!
{ "connectionId": "YOUR_CONNECTION_ID", "method": "sendMessage", "params": [ "[email protected]", { "text": "Hi! I will mention @1234567890" }, { "mentions": [ "[email protected]" ] } ] }
- send a location!
{ "connectionId": "YOUR_CONNECTION_ID", "method": "sendMessage", "params": [ "[email protected]", { "location": { "degreesLatitude": 24.121231, "degreesLongitude": 55.1121221 } } ] }
- send a contact!
This one is tricky, you have to encode the data in a VCard format.{ "connectionId": "YOUR_CONNECTION_ID", "method": "sendMessage", "params": [ "[email protected]", { "contacts": { "displayName": "Jeff", "contacts": [ { "vcard": "BEGIN:VCARD\nVERSION:3.0\nFN:Jeff Singh\nORG:Ashoka Uni;\nTEL;type=CELL;type=VOICE;waid=911234567890:+91 12345 67890\nEND:VCARD" } ] } } ] }
- send a contact!
This one is tricky, you have to encode the data in a VCard format.{ "connectionId": "YOUR_CONNECTION_ID", "method": "sendMessage", "params": [ "[email protected]", { "contacts": { "displayName": "Jeff", "contacts": [ { "vcard": "BEGIN:VCARD\nVERSION:3.0\nFN:Jeff Singh\nORG:Ashoka Uni;\nTEL;type=CELL;type=VOICE;waid=911234567890:+91 12345 67890\nEND:VCARD" } ] } } ] }
- send a reaction!
{ "connectionId": "YOUR_CONNECTION_ID", "method": "sendMessage", "params": [ "[email protected]", { "react": { "text": "💖", "key": "MESSAGE_KEY_WHICH_YOU_RECEVED_THOUGH_EVENTS" } } ] }
- send a buttons message!
This may not work all the time or at all (whatsapp fault.).{ "connectionId": "YOUR_CONNECTION_ID", "method": "sendMessage", "params": [ "[email protected]", { "text": "Hi it's button message", "footer": "Hello World", "buttons": [ { "buttonId": "id1", "buttonText": { "displayText": "Button 1" }, "type": 1 }, { "buttonId": "id2", "buttonText": { "displayText": "Button 2" }, "type": 1 }, { "buttonId": "id3", "buttonText": { "displayText": "Button 3" }, "type": 1 } ], "headerType": 1 } ] }
- send a template message!
This may not work all the time or at all (whatsapp fault.).{ "connectionId": "YOUR_CONNECTION_ID", "method": "sendMessage", "params": [ "[email protected]", { "text": "Hi it's a template message", "footer": "Hello World", "templateButtons": [ { "index": 1, "urlButton": { "displayText": "Checkout whats2api!", "url": "https://whats2api.com" } }, { "index": 2, "callButton": { "displayText": "Call me!", "phoneNumber": "+1 (234) 5678-901" } }, { "index": 3, "quickReplyButton": { "displayText": "This is a reply, just like normal buttons!", "id": "id-like-buttons-message" } } ] } ] }
- send a list!
This may not work all the time or at all (whatsapp fault.).{ "connectionId": "YOUR_CONNECTION_ID", "method": "sendMessage", "params": [ "[email protected]", { "text": "This is a list", "footer": "nice footer, link: https://google.com", "title": "Amazing boldfaced list title", "buttonText": "Required, text on the button to view the list", "sections": [ { "title": "Section 1", "rows": [ { "title": "Option 1", "rowId": "option1" }, { "title": "Option 2", "rowId": "option2", "description": "This is a description" } ] }, { "title": "Section 2", "rows": [ { "title": "Option 3", "rowId": "option3" }, { "title": "Option 4", "rowId": "option4", "description": "This is a description V2" } ] } ] } ] }