Skip to main content

What is the api of WhatsApp?


What is the api of WhatsApp?
WhatsApp has released a “Click to Chat” function where you can create links where the person can start a conversation  with you without  it having the saved phone number. With this function you can even add standard texts for the person to send to you.

How to Fix WhatsApp Api in Desktop Browsers
What’s the problem?
There are two bases for you to do this solution: api.whatsapp and web.whatsapp. Throughout the internet you will find people teaching with api., However in some tests I realized that it does not work in Firefox and Safari desktop browsers. These only work the web.whatsapp and the web does not work on mobiles.



A Change where “YOURNUMBER” is by its number in the following format 15551234567, without the “+” and “()”..
Replace the text “YOURTEXT” with what you want the person to send by changing the space for “+”. Ex. “I+Want”
Save the file named index.php and upload it to your server.

How to Solve?
This can be solved with a simple script that will redirect the user according to the device he is using.


<?php
// Fix Api Whatsapp on Desktops
// Dev: Jean Livino
$iphone = strpos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$android = strpos($_SERVER['HTTP_USER_AGENT'],"Android");
$palmpre = strpos($_SERVER['HTTP_USER_AGENT'],"webOS");
$berry = strpos($_SERVER['HTTP_USER_AGENT'],"BlackBerry");
$ipod = strpos($_SERVER['HTTP_USER_AGENT'],"iPod");
// check if is a mobile
if ($iphone || $android || $palmpre || $ipod || $berry == true)
{
 header('Location: https://api.whatsapp.com/send?phone=YOURNUMBER&text=YOURTEXT');
 //OR
 echo "<script>window.location='https://api.whatsapp.com/send?phone=YOURNUMBER&text=YOURTEXT'</script>";
}
// all others
else {
 header('Location: https://web.whatsapp.com/send?phone=YOURNUMBER&text=YOURTEXT');
 //OR
 echo "<script>window.location='https://web.whatsapp.com/send?phone=YOURNUMBER&text=YOURTEXT'</script>";
}

Comments

Post a Comment

Popular posts from this blog

Blockchain will create $ 176B in business value by 2025

Blockchain will create $ 176B in business value by 2025 Blockchain technology is field with new opportunities, disarming any threats or challenges, and advances the discussion on the future of. Simras Technology Pvt. Ltd is a renowned digital marketing company which offers blockchain SEO services. We are here to create the targeted audience in an ethical way.   Trends of blockchain The value of blockchain will grow to slightly more than $ 176 billion in 2025 and it can be increase up to $ 3.1 trillion by 2030. The value of blockchain forecast to reach $2.1 billion in 2018, more than double the $946 million spent in 2017.  The value of blockchain robust pace over the 2016 to 2017. During this period forecast to reach $2.1 billion in 2018, more than double the $946 million spent in 2017. The annual growth rate of 81.2 percent and total spending of $9.7 billion in 2021. "The United States will find the largest blockchain investments and provide more than 40 perce...

The best short term cryptocurrency 2019

In this article, we are discussing about the short-term and top cryptocurrencies of year 2019. Moreover we also discuss about the investment benefit in these cryptocurrencies: EOS-  EOS is the biggest Rival of Ethereum and we can see the bright future of this broken. As a price of EOS is increasing day by day and find so many positive response among the cryptocurrency enthusiasts . Ripple: With the starting of 2019 year, we can see also positive sign in ripple growth. From last six month, the experts find ripple growing day by day unexpected at the year of end you can make good money by the investment of ripple. TRON: TRON is rising as the biggest digital currency at the end of 2018. And it Kane certain growth in last 2 month of year 2019. So you have the best option to invest in cryptocurrency as a TRON. Litecoin- by the starting of year 2019, you can also see positive growth sign in litecoin. The cryptocurrency experts find positive growth in litecoin stock mar...