Send WhatsAPP Message API using PHP Step By Step
Welcome on Pakainfo.com – Examples ,The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to WhatsAPP send and receive Message API using PHP Step By Step
In this post we will show you Best way to implement Send WhatsAPP Message API using PHP Step By Step, hear for How to How to send and receive message on whatsapp using PHP Script with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.
How to Send a Message by WhatsApp API using PHP easily?
To send a message via WhatsApp API using PHP, you can use a third-party library called “Chat API”. Here are the steps to do it:
Create an account on Chat API website: Go to https://app.chat-api.com/signup and create an account.
Verify your phone number: After creating your account, verify your phone number by following the instructions provided by Chat API.
Get an API key: Once your phone number is verified, you can get an API key from the Chat API dashboard.
Install Chat API library: You can install the Chat API library using Composer. Open your terminal or command prompt, navigate to your project directory and run the following command:
composer require chatapi/whats-app-api
Send a message: After installing the Chat API library, you can send a message via WhatsApp using the following PHP code:
<?php require_once 'vendor/autoload.php'; use ChatApi\Whatsapp\ChatApi; $apiKey = 'YOUR_API_KEY'; $phone = 'RECEIVER_PHONE_NUMBER'; $message = 'YOUR_MESSAGE'; $chatApi = new ChatApi($apiKey); $response = $chatApi->sendMessage($phone, $message); echo $response;
In the above code, replace YOUR_API_KEY with your actual Chat API key, RECEIVER_PHONE_NUMBER with the phone number of the recipient (including the country code but without any spaces, brackets or dashes), and YOUR_MESSAGE with the actual message you want to send.
That’s it! With this code, you can easily send messages via WhatsApp using PHP and the Chat API library.
WhatsAPP send and receive Message API using PHP Step By Step
If we need to send some message WhatsApp your_msg to your friend or family members or groups from Web-application, we need to find simple unofficial whatsapp API as well as WhatsApp API till date do not any data provide them, and do not simple allow bulk messaging like as well. here available some steps and code But in one of my web-application project, We need to some send your_msg on whatsapp API, for those who subscribe on my website to some code recieve those about here our service updates.
Phase 1 :
Phase 1 :So, We use simple WhatsApi and 100% free (https://github.com/mgp25/WhatsAPI-Official),
Phase 2 :simply so it was most each recommended whatsapp API We easily found.
Phase 3 :We didn’t even each try any other whatsapp API code, as it step by step works like and learn for me.
Phase 4 :It has simple jQuery AjaxDemo folder in there available, with simple 3 files.
all the anyone easly and simple can easily learn step by stepthe coding from it.
Phase 5 :So, We don’t go in some use to much of simple script coding part in this POST. But here is simple and easy steps with some script or code.
To start with,
How to send and receive message on whatsapp using PHP Script
Step 1: You will need a your Mobile number that shell be used to send your_msgs. create any sure that we can recieve all the SMS on this number to mobile phone to verify steps to the Whatsapp account.
Step 2: Once we have create your phone ready, download simple here whatsapp api WART (https://github.com/shirioko/WART) here which provide a simple EXE file to run, to enter simple your phone number and get a your_strong_pass for whatsapp API. Remember to konw Whatsapp send your_strong_pass once every about 30 minute as well as so if we want to get new your_strong_pass we have to just wait about 30 minutes.
Step 3: Now, last step to that we have mobile WhatsAPP cell phone and your_strong_pass, simply try this code.
Send WhatsApp messages via PHP using WhatsAPI
require_once 'whatsprot.class.php'; $username = "your username"; //Mobile Phone cell to prefixed with your country code so for india like as a it will be 9898225076 $your_strong_pass = "someyour_strong_passstring"; $mywp = new WhatsProt($username, 0, "WhatsApp Messaging", true); //Name simple your application by and replacing here like as a "WhatsApp Messaging" $mywp->connect(); $mywp->loginWithyour_strong_pass($your_strong_pass); $your_target = '9898404025'; //your_target Phone as well as,reciever phone $your_msg = 'We love we my sweet hart...'; $mywp->SendPresenceSubscription($your_target); //Let us first simple and steps to send presence to user $mywp->sendyour_msg($your_target,$your_msg ); // Send simple your_msg
Send messages to whatsapp number using PHP
Yes, it was that simple. we can send simple media like as a Image file and Video as well, but We am sure not going to explain data file them here, so to send Media we make a need to call $mywp->pollyour_msgs()’ So your your_msg won’t be sent.
Note: all the Phone must your simple prefix the use the country code as well as it won’t and data send your_msgs. To send simple media Like as a images,video and mp3, we can simple either give ypur Physical path as well ass a URL to media resource.
so free download API from simple this url go to and click to https://github.com/mgp25/WhatsAPI-Official and some change your really credentials in example Like as a -> whatsapp.php file
To make two way data binding like as a processing use jQuery ajaxdemo folder.
I hope you have Got Send WhatsApp messages via PHP using WhatsAPI And how it works.I would Like to have FeadBack From My Blog(Pakainfo.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(Pakainfo.com) Are Most Always Welcome.