Whatsapp Direct Api - IamCK

Whatsapp Direct Api

A Whatsapp direct message api had deploy to heroku, and assign to wa.chunkeat.me.

When direct request to wa.chunkeat.me, it will redirect to chunkeat.me/b/2020/09/20/api.html,

but when it follow the link rules below :

https://wa.chunkeat.me/<phone number>/<message>/

DEMO

The whatsapp link can be generate here

With this to send a massage to an Unknown, saving phone number to phone contact is not required.

In the computer with Whatsapp for Window installed, wa.chunkeat.me will pull up the window apps.

Since heroku free plan can’t upload SSL certificate, so cloudflare CDN is use to apply cloudflare SSL.

  1. A CNAME record point the subdomain to heroku dns (a SSL Handshake Error will return in this stage)
  2. Change the CNAME target to <>.herokuapp.com.
  3. Then the cloudflare SSL certificate can be apply to to subdomain.
    • CDN must be apply for the SSL certificate

The teory is when the cloudflare SSL/TLS encryption mode is set to full, the cloudflare server required the origin server to have a valid SSL certificate for the connection, but in the first step the CNAME is pointed to the heroku dns which does not have an valid SSL certificate.

However, all domain end with *.herokuapp.com had an valid SSL certificate provide by heroku, so that in the second step changing the CNAME target to <>.herokuapp.com will made the cloudflare server able to connect with the origin server with a valid heroku SSL certificate.