mathsgod/whatsapp-client

A PHP client for WhatsApp API

Installs: 9

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 1

pkg:composer/mathsgod/whatsapp-client

1.0.0 2023-07-04 04:35 UTC

This package is auto-updated.

Last update: 2025-10-04 13:55:33 UTC


README

Description

This is a simple WhatsApp client that uses the WhatsApp Web API to send and receive messages.

Installation

composer require mathsgod/whatsapp-client

Usage

You can generate token from https://business.facebook.com/settings/system-users/

Phone number id is not phone number, find it in https://developers.facebook.com/apps/{app_id}/whatsapp-business/wa-dev-console/

Send a text message

$wa = new WhatsApp\Client($token, $phone_number_id);

$wa->sendText("85298765432","Hello World!");

Send a document

$wa = new WhatsApp\Client($token, $phone_number_id);

$wa->sendDocument("85298765432",$url,"document.pdf");