
Connect with your customers easily by using tools to automate, sort and quickly respond to messages. An API connection to a service requires controlling how the URL is decoded. If something goes wrong, you can re-deploy stateless components, and they can grow to manage traffic shifts. Create a catalog to showcase your products and services. REST API calls are ideal for cloud applications due to their statelessness. If the message is sent successfully, the number you entered will receive it and you will get back the msg as the response. WhatsApp Business is a free to download app that was built with the small business owner in mind. The reason why until today it has not been possible to use WhatsApp with multiple users at the same time, and therefore to manage the same phone number from more than one device at a time, is that the app did not have public APIs.
#How to use whatsapp api code#
In the number field, add the mobile number followed by the country code of the number. Here's the linkĬreate a New Request in Thunder Client, and then add the following details. This involves initiating a request via Twilio. Now in VS Code itself, we'll use an extension called Thunder Client, which works like Postman for API testing. If you want to start using the Twilio API in production you need to enable your Twilio numbers for WhatsApp. Once authenticated, you will notice that a session.json file has been created with the following contents. So, you have to scan it through WhatsApp. Running the server will give us the QR Code to authenticate because it's the first time.

Quick Reply and Call to Action can only be used in template messages that open the 24th dialog windows with clients. That will open up a browser (if you've set headless to false) Call to Action which in turn is divided into a button to go to the URL or to request a call - ListMessages a request for a small menu or FAQ with possible answers. In order to test our API, we first run it using npm run dev. At its core, the WhatsApp Business API client is based on Docker.
#How to use whatsapp api install#
#How to use whatsapp api how to#
With the mobile number, we have to attach at the very end, so we do that with template literals in JavaScript. How to Get WhatsApp API: WhatsApp API Integration 1 week ago Now here, in the sendMessage method, we pass in the mobile number and the message itself. We can alter the file as follows, const express = require( 'express') Ĭonst createError = require( 'http-errors') Ĭonst = req.body // Get the body const msg = await ndMessage( ` message) // Send the message

npm i whatsapp-web.jsĪfter we're done with that, we can set it up in our app.js file by following the given example. First, we'll install it through NPM or yarn.
