Git Product home page Git Product logo

php-whatsapp-chatbot's Introduction

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, "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

$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

php-whatsapp-chatbot's People

Contributors

ultramsg avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.