Step 1 : Create new WhatsApp group
you can create groups through your Mobile and add members for Sending messages to these groups.
Step 2 : Get WhatsApp groups ID
To be able to send messages to a group, you must know the group ID, you can make GET request or via ultramsg documentation :
EXAMPLE JSON RESPONSE :
[
{
"id": "[email protected]",
"name": "group name",
"isGroup": true,
"groupMetadata": {
"description": "",
"owner": "[email protected]",
"creation": 1511456874,
"participants": [
{
"id": "[email protected]",
"isAdmin": false,
"isSuperAdmin": false
},
{
"id": "[email protected]",
"isAdmin": true,
"isSuperAdmin": false
}
]
},
"last_time": 1637644088,
"archived": true,
"pinned": false,
"isMuted": false
}
]
Now we have the group id: [email protected]
Step 3 : Send message to group
https://api.ultramsg.com/{INSTANCE_ID}/messages/chat
Parameter | description |
---|---|
to | Group ID, We’ve got In the second step: 10172127175-[email protected] |
body | Message text, UTF-8 or UTF-16 string with emoji Max length: 4096 char. |
you can read this article to send WhatsApp messages using PHP language.