Send Whatsapp from Blogspot?

Hi there!

Have you ever wondering on how to create a link on blogspot that can trigger a send message on whatsapp?

here it is, the guide on how to do this. we will use javascript:
<script>
window.location="https://api.whatsapp.com/send?phone=60123456789&text=hello!";
</script>

yep. basically. that is the code.
<script>
window.location= "https://api.whatsapp.com/send?phone=60123456789";
</script>

change your number in the code above. but remain the 6

FURTHER BREAKDOWN

https://api.whatsapp.com/send
This is the main API access provided by whatsapp.

?phone=60123456789
This is the phone number used for making call to the phonebook. Important to put the country code. Malaysia use 6 in front.

?text=hello!
This is the message that will appear in the whatsapp message input

 

SETUP BLANK PAGE IN BLOGGER

Now. in blogger. create a new blank page. (i have created test-whatsapp page)

now. we will want to edit this page using code editor. which is HTML editor. see the tabs on top left screen.

html editor blogspot

now. we paste the code <script></script> inside the editor

then, save/update the page.

you can try to view the page after you had saved it. it will surely go to the correct whatsapp app. if you are in mobile. It will open the whatsapp mobile app, if you are in PC, it will open up whatsapp web.

LAST STEP?

use the page link anywhere you would want it. in your blog post, in your facebook post. you name it.

whenever people are clicking on that link. they will be redirected to the correct whatsapp phone number and message too!

here is an example of my old blogspot that i used to make this tutorial:

http://techno-ai.blogspot.com/p/test-whatsapp.html

 

WHAT IF ITS A LONG TEXT?

yeah. probably you will have a long initial text for your customer to initiate a pretty text. For this to work, you will need a converter. You cant pass an empty space to the whatsapp API. you will have to convert your test into “URL-ENCODED” type. like this:

hai!%0Anak%20tanye%20boleh%3F
so, your full coding should look like this:

<script>
window.location = "https://api.whatsapp.com/send/?phone=60123456789&text=hai!%0Anak%20tanye%20boleh%3F";
</script>

it will output text:
Hai
nak tanye boleh?

How to convert the text?

use this online text encoder:

https://meyerweb.com/eric/tools/dencoder/

type any text you want, then press encode!

use it on the &text=your%20encoded%20text%20here

enjoy!

faiz