Make WhatsApp ChatBot and use WhatsApp API to send the WhatsApp messages in php .

Overview

Ultramsg.com WhatsApp Bot using WhatsApp API and ultramsg

Demo WhatsApp API ChatBot using Ultramsg API 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.
  • 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 .

 

Run a chatbot

step1

put your instance ID and Token in example.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

$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

$this->client->sendImageMessage($to, "image Caption", "https://file-example.s3-accelerate.amazonaws.com/images/test.jpg");
  • $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

$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

$this->client->sendVideoMessage($to, "https://file-example.s3-accelerate.amazonaws.com/video/test.mp4");

sendAudioMessage

Send a audio file to phone number or group

$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

$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

$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

 

Youtube | WhatsApp api using PHP SDK

Send Message by WhatsApp api using PHP SDK | Ultramsg PHP SDK

You might also like...
PHP OOP interface for writing Slack Block Kit messages and modals
PHP OOP interface for writing Slack Block Kit messages and modals

Slack Block Kit for PHP 👉 For formatting messages and modals for Slack using their Block Kit syntax via an OOP interface 👈 By Jeremy Lindblom (@jere

Parse DSN strings into value objects to make them easier to use, pass around and manipulate

DSN parser Parse DSN strings into value objects to make them easier to use, pass around and manipulate. Install Via Composer composer require nyholm/d

The fastest way to make a powerful JSON:API compatible Rest API with Laravel.
The fastest way to make a powerful JSON:API compatible Rest API with Laravel.

The first fully customizable Laravel JSON:API builder. "CRUD" and protect your resources with 0 (zero) extra line of code. Installation You can instal

jMQTT is a plugin for Jeedom aiming to connect Jeedom to an MQTT broker to subscribe and publish messages
jMQTT is a plugin for Jeedom aiming to connect Jeedom to an MQTT broker to subscribe and publish messages

jMQTT is a plugin for Jeedom aiming to connect Jeedom to an MQTT broker to subscribe and publish messages

Private groups to share messages, photos, videos, links with friends and family.
Private groups to share messages, photos, videos, links with friends and family.

A truly private space for you and your friends What is Zusam ? Zusam (/tsuˈzam/) is a free and open-source way to self-host private forums for groups

PHP-nats publisher - This is a simple package to publish messages to Nats

Nats publisher This is a simple package to publish messages to Nats Installation You can install the package using the Composer package manager. You c

Laravel package to make it easy to use the gorgeous emojis from EmojiOne
Laravel package to make it easy to use the gorgeous emojis from EmojiOne

laravel-emojione Laravel package to make it easier working with the gorgeous emojis from EmojiOne. Remember to read the EmojiOne Free License and prov

The Laravel eCommerce Accept Payment Gateway allows the customer to make use of Accept payment gateway in the Bagisto eCommerce website.

Introduction Bagisto WeAccept add-on allow customers to pay for others using WeAccept payment gateway. Requirements: Bagisto: 1.3.2 Installation with

Laravel & MySQL, jQuery, Ajax, Bootstrap. Also, it's include email send function without any API.
Laravel & MySQL, jQuery, Ajax, Bootstrap. Also, it's include email send function without any API.

Rewards-Dacor Laravel & MySQL, jQuery, Ajax, Bootstrap. Also, it's include email send function without any API. [Live site link] ( https://rewardsdaco

Releases(v1.0.1)
Owner
Ultramsg
WhatsApp API gateway for chatbot and sending messages, media, marketing campaigns for PHP, nodejs , JavaScript, and Python
Ultramsg
A simple plugin that replaces the sms channel with Whatsapp Web channel through Wo-Wa Whatsapp service

Mautic Whatsapp Plugin This plugin replaces the SMS channel and allows you to send messages to Whatsapp using the Wo-Wa Whatsapp Web application. Inte

Joey Keller 9 Dec 16, 2022
A fully-managed real-time messaging service that allows you to send and receive messages between independent applications.

A fully-managed real-time messaging service that allows you to send and receive messages between independent applications.

Google APIs 58 Dec 23, 2022
An easy code to send messages on a discord text channel with webhook.

Status Webhook-Discord An easy code to send messages on a discord text channel with webhook. Don't forget to check the latest version of Webhook-Disco

Victor 1 Dec 3, 2021
The best announcer for PocketMine-MP 4.0 servers, make messages for your users very easily

BroadcastACM The best announcer for PocketMine-MP 4.0 servers, make messages for your users very easily. Make the best announcements for your server w

fernanACM 3 May 30, 2022
A simple PHP package for sending messages to Slack, with a focus on ease of use and elegant syntax.

Slack for PHP A simple PHP package for sending messages to Slack with incoming webhooks, focussed on ease-of-use and elegant syntax. Note: this packag

Regan McEntyre 1.2k Oct 29, 2022
A PHP package to make the Chronopost API easier to use.

Chronopost API A PHP package to make the Chronopost API easier to use. Table of Contents Requirements Installation Usage Testing Requirements PHP 7.3,

HOUIS Mathis 9 Oct 27, 2022
Opensource php wrapper to WhatsApp Cloud API.

WhatsApp Latest Cloud API Wrapper for PHP Opensource php wrapper to WhatsApp Cloud API. Features supported Sending messages Sending Media (images, aud

Novath Thomas 58 Nov 30, 2022
Jéssica Paula 7 Aug 12, 2022
Start using Whatsapp Business Cloud API in your app

Use The Most Used Whatsapp's Cloud API Start using Whatsapp Business Cloud API in your app! Support us Investing on this package is defintely a good m

Ricardo Sawir 15 Dec 14, 2022