Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ultramsg/php-whatsapp-chatbot
Make WhatsApp ChatBot and use WhatsApp API to send the WhatsApp messages in php .
https://github.com/ultramsg/php-whatsapp-chatbot
chat-bot chatbot php-bot php-chatbot whatsapp-api whatsapp-api-php whatsapp-bot whatsapp-chat
Last synced: 3 months ago
JSON representation
Make WhatsApp ChatBot and use WhatsApp API to send the WhatsApp messages in php .
- Host: GitHub
- URL: https://github.com/ultramsg/php-whatsapp-chatbot
- Owner: ultramsg
- License: mit
- Created: 2022-03-25T20:58:30.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-08T06:55:54.000Z (about 2 years ago)
- Last Synced: 2024-10-01T07:41:11.180Z (3 months ago)
- Topics: chat-bot, chatbot, php-bot, php-chatbot, whatsapp-api, whatsapp-api-php, whatsapp-bot, whatsapp-chat
- Language: PHP
- Homepage: https://ultramsg.com
- Size: 1020 KB
- Stars: 53
- Watchers: 5
- Forks: 27
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [Ultramsg.com](https://ultramsg.com/?utm_source=github&utm_medium=php&utm_campaign=chatbot) WhatsApp Bot using WhatsApp API and ultramsg
Demo WhatsApp API ChatBot using [Ultramsg API](https://ultramsg.com/?utm_source=github&utm_medium=php&utm_campaign=chatbot) with php.# Chatbot tasks:
- The output of the command list .
- The output of the server time of the bot running on .
- Sending image to phone number or group .
- Sending audio file .
- Sending ppt audio recording .
- Sending Video File.
- Sending contact .
- Sending Random Sentence .
- Sending Random Joke .
- Sending Random Image .# Getting Started
- Ultramsg account is required to run examples. Log in or Create Account if you don't have one [ultramsg.com](https://ultramsg.com/?utm_source=github&utm_medium=php&utm_campaign=chatbot).
- go to your instance or Create one if you haven't already.
- Scan Qr and make sure that instance Auth Status : authenticated .
# webhook json format
To see how the received JSON will look this [video](https://www.youtube.com/watch?v=kipBHDOsFKI) .
# Run a chatbot## step1
put your instance ID and Token in example.php
```php
new ultraMsgChatBot("token", "instance_id");
```## step2
activate the "Webhook on Received" option and Set URL Webhook in Instance settings in ultramsg
for example :
https://yourwebsite.com/chatbot/example.php## step3
Upload the project/folder to your server or website .** Congratulations.. you can now talk to your chatbot **
# Functions## sendChatMessage
Used to send WhatsApp text messages
```php
$this->client->sendChatMessage($to, date('d.m.Y H:i:s'));
```
- $to – ID of the chat where the message should be sent for him, e.g [email protected] .## sendImageMessage
Send a image to phone number or group
```php
$this->client->sendImageMessage($to, "https://file-example.s3-accelerate.amazonaws.com/images/test.jpg", "image Caption");```
- $to – ID of the chat where the message should be sent for him, e.g [email protected] .## sendDocumentMessage
Send a document to phone number or group
```php
$this->client->sendDocumentMessage($to, "cv.pdf", "https://file-example.s3-accelerate.amazonaws.com/documents/cv.pdf");
```## sendVideoMessage
Send a Video to phone number or group
```php
$this->client->sendVideoMessage($to, "https://file-example.s3-accelerate.amazonaws.com/video/test.mp4");```
## sendAudioMessage
Send a audio file to phone number or group
```php
$this->client->sendAudioMessage($to, "https://file-example.s3-accelerate.amazonaws.com/audio/2.mp3");
```## sendVoiceMessage
Send a ppt audio recording to phone number or group
```php
$this->client->sendVoiceMessage($to, "https://file-example.s3-accelerate.amazonaws.com/voice/oog_example.ogg");```
## sendContactMessage
Sending one contact or contact list to phone number or group
```php
$this->client->sendContactMessage($to, "[email protected]");
```
# WhatsApp API PHP SDK
You can see Lightweight PHP library for WhatsApp API to send the whatsappp messages in PHP provided by Ultramsg.com
[WhatsApp API PHP SDK](https://github.com/ultramsg/whatsapp-php-sdk)
# Youtube | WhatsApp api using PHP SDK
[![Send Message by WhatsApp api using PHP SDK | Ultramsg PHP SDK
](https://img.youtube.com/vi/OqDOKyMIp20/0.jpg)](https://www.youtube.com/watch?v=OqDOKyMIp20)