Skip to content

A Node.js module for sending WhatsApp messages using the Maytapi WhatsApp API. Efficient and Promise-based WhatsApp integration for Node.js applications.

License

Notifications You must be signed in to change notification settings

maytapi-com/send-a-message-with-nodejs-using-whatsapp-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Send a Message Using Node.js with Maytapi WhatsApp API

This repository demonstrates how to send a WhatsApp message using Node.js and the Maytapi WhatsApp API. Maytapi provides a powerful and easy-to-use API for integrating WhatsApp messaging into your applications.

Features

  • Send text messages to WhatsApp numbers
  • Easy integration with Maytapi WhatsApp API
  • Configurable settings for API credentials
  • Modern JavaScript features (async/await, ES6+)

Requirements

  • Node.js 12.0 or higher
  • npm (Node Package Manager)
  • Maytapi account and API credentials

Installation

  1. Clone this repository:
https://github.com/maytapi-com/send-a-message-with-nodejs-using-whatsapp-api.git
cd project-folder
  1. Install dependencies:
npm i
  1. Edit src/config.js and add your Maytapi credentials:
module.exports = {
    PRODUCT_ID: 'your_product_id',
    PHONE_ID: 'your_phone_id',
    API_KEY: 'your_api_key'
};

Usage

To send a test message:

node src/sendMessage.js

To use in your own project:

  1. Import the sendWhatsAppMessage function:
const sendWhatsAppMessage = require('./src/sendMessage');
  1. Use the function in your code:
sendWhatsAppMessage("905301234567", "Hello World!")
  .then(result => console.log(result))
  .catch(error => console.error(error));

Note

To perform all these operations correctly, you need to register with maytapi.com, get the credentials, and place them in the config file.

Why Maytapi?

Maytapi offers a robust WhatsApp API solution with features like:

  • Multi-device support
  • Affordable pricing
  • Easy integration
  • Comprehensive documentation

Learn more about Maytapi's WhatsApp API and how it can benefit your projects.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

For questions about Maytapi's WhatsApp API, visit official documentation or contact support team.

About

A Node.js module for sending WhatsApp messages using the Maytapi WhatsApp API. Efficient and Promise-based WhatsApp integration for Node.js applications.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published