2022-07-25
5391
#ecommerce#node
Daggie Douglas Mwangi
125063
Jul 25, 2022 ⋅ 19 min read

Build an automated ecommerce app with WhatsApp Cloud API and Node.js

Daggie Douglas Mwangi My name is Daggie. I am a software engineer, a polymath, a product hacker-cum-builder, and a developer mentor. Through these articles, I will walk you through APIs, product hacks, code best practices, emerging tech, and everything in between. Follow me on Twitter and GitHub @daggieblanqx.

Recent posts:

How To Integrate WunderGraph With Your Frontend Application

How to integrate WunderGraph with your frontend application

Unify and simplify APIs using WunderGraph to integrate REST, GraphQL, and databases in a single endpoint.

Boemo Mmopelwa
May 17, 2024 ⋅ 5 min read
Understanding The Latest Webkit Features In Safari 17.4

Understanding the latest Webkit features in Safari 17.4

The Safari 17.4 update brought in many modern features and bug fixes. Explore the major development-specific updates you should be aware of.

Rahul Chhodde
May 16, 2024 ⋅ 10 min read
Using Webrtc To Implement Peer To Peer Video Streaming In A Node Js Project

Using WebRTC to implement P2P video streaming

Explore one of WebRTC’s major use cases in this step-by-step tutorial: live peer-to-peer audio and video streaming between systems.

Oduah Chigozie
May 16, 2024 ⋅ 18 min read
Htmx Vs React

htmx vs. React: Choosing the right library for your project

Both htmx and React provide powerful tools for building web apps, but in different ways that are suited to different types of projects.

Temitope Oyedele
May 15, 2024 ⋅ 9 min read
View all posts

21 Replies to "Build an automated ecommerce app with WhatsApp Cloud API and Node.js"

  1. I have a problem, I tried to make my own, I even tested your application, but anyway it seems that it goes into a loop, the chatbot keeps flooding, it seems to have something to do with the webhooks, in addition to those webhook configurations, something was missing that you forgot to suggest?

    1. Hello, I am getting a 404 error and facebook is not validating my callback link. You have any idea why the app.js file is not picking up the indexroutes

    2. Hi @Rebot
      Im reaching out to see if you managed to get around the “chatbot flooding messages to users” part?
      I created mine too and from time to time the chatbot seems to send duplicate responses to users?

  2. A brilliant blog and an even better Node.js library. I can highly recommend the library to ANY developer wanting to integrate with the WhatsApp Cloud API. Well done to all contributors!

  3. Thanks for the example it works but I get a cyclic repetition of the POST.
    POST: Someone is pinging me!
    POST: Someone is pinging me!
    POST: Someone is pinging me!
    POST: Someone is pinging me!

    How can I avoid it?. Thank you.

    1. Hello @Jairo and @Rebot.

      Change the below block of code from:

      const WhatsappCloudAPI = require(‘whatsappcloudapi_wrapper’);
      const Whatsapp = new WhatsappCloudAPI({
      accessToken: process.env.Meta_WA_accessToken,
      senderPhoneNumberId: process.env.Meta_WA_SenderPhoneNumberId,
      WABA_ID: process.env.Meta_WA_wabaId,
      });

      to this:

      const WhatsappCloudAPI = require(‘whatsappcloudapi_wrapper’);
      const Whatsapp = new WhatsappCloudAPI({
      accessToken: process.env.Meta_WA_accessToken,
      senderPhoneNumberId: process.env.Meta_WA_SenderPhoneNumberId,
      WABA_ID: process.env.Meta_WA_wabaId,
      graphAPIVersion:’ v14.0′
      });

  4. Olá.

    Estoura um erro no console quando realizo um teste no webhook.

    POST: Someone is pinging me!
    {
    error: Error: WABA_ID is not valid. Hint: the message is not intended for this Whatsapp Business Account.
    at module.exports (C:\Users\cleyton\Documents\app.whatsOficial\api-whats-oficial\node_modules\whatsappcloudapi_wrapper\msg_parser.js:24:15)
    at WhatsappCloud.parseMessage (C:\Users\cleyton\Documents\app.whatsOficial\api-whats-oficial\node_modules\whatsappcloudapi_wrapper\index.js:867:16)
    at C:\Users\cleyton\Documents\app.whatsOficial\api-whats-oficial\routes\index.js:43:25
    at Layer.handle [as handle_request] (C:\Users\cleyton\Documents\app.whatsOficial\api-whats-oficial\node_modules\express\lib\router\layer.js:95:5)
    at next (C:\Users\cleyton\Documents\app.whatsOficial\api-whats-oficial\node_modules\express\lib\router\route.js:144:13)
    at Route.dispatch (C:\Users\cleyton\Documents\app.whatsOficial\api-whats-oficial\node_modules\express\lib\router\route.js:114:3)
    at Layer.handle [as handle_request] (C:\Users\cleyton\Documents\app.whatsOficial\api-whats-oficial\node_modules\express\lib\router\layer.js:95:5)
    at C:\Users\cleyton\Documents\app.whatsOficial\api-whats-oficial\node_modules\express\lib\router\index.js:284:15
    at Function.process_params (C:\Users\cleyton\Documents\app.whatsOficial\api-whats-oficial\node_modules\express\lib\router\index.js:346:12)
    at next (C:\Users\cleyton\Documents\app.whatsOficial\api-whats-oficial\node_modules\express\lib\router\index.js:280:10)

    Pode ajudar o que pode ser esse erro, ja verigiquei o id da conta Bussiness.

  5. Hi.I was following this tutorial and was working for a month it was working fine but when now I am trying to configure webhook i am getting an “The callback URL or verify token couldn’t be validated. Please verify the provided information or try again later” error.I tried to create with all new accounts but still i am getting this error.Can you please suggest what should I do?

    1. Olá. Passei por problema parecido.
      Tente a tag — region au no ngrok.
      Na documentação você pode especificar a região do seu servidor usando essa tag. Ficando:
      ngrok http 8000 –region au
      Na documentação tem as regiões disponíveis.

  6. Hie. Thanks for this great article. I have been following through the steps outlines but when i try to configure webhooks url on facebook it gives this error.
    “The URL couldn’t be validated. Response does not match challenge, expected value=”481656951″, received=”\u003C!DOCTYPE html>\n\u003Ch…“

  7. Hie. I am getting this error when i try to configure webhooks
    `The URL couldn’t be validated. Response does not match challenge, expected value=”481656951″, received=”\u003C!DOCTYPE html>\n\u003Ch…”`

  8. Dear @daggieblanqx,

    I wanted to express my gratitude for the outstanding work you have done on this article. Your clear and concise step-by-step instructions have made it easy for anyone to understand and implement. As a result, I was able to successfully create an ecommerce WhatsApp bot using your guidance. Your hard work has paid off and I want to give you my sincerest compliments. Keep up the excellent work.

    Best regards,

    Luke

Leave a Reply