PHPackages                             the-box/box-whatsapp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. the-box/box-whatsapp

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

the-box/box-whatsapp
====================

The WhatsApp Box is part of the TheBox family — a lightweight PHP package that allows you to send WhatsApp messages easily

20PHP

Since May 12Pushed 1mo agoCompare

[ Source](https://github.com/Onestepcom00/WhatsappBox)[ Packagist](https://packagist.org/packages/the-box/box-whatsapp)[ RSS](/packages/the-box-box-whatsapp/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

BoxWhatsapp
===========

[](#boxwhatsapp)

[![PHP Version](https://camo.githubusercontent.com/ce0c70c519047d0e507604f03e6e8ae6c27bcc072027e899680d9bf93804dc76/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e342532422d626c7565)](https://camo.githubusercontent.com/ce0c70c519047d0e507604f03e6e8ae6c27bcc072027e899680d9bf93804dc76/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e342532422d626c7565)[![License](https://camo.githubusercontent.com/5caa455d8debc46fb23abbadb45a733a937f3910a73fc875c2f7820468e1bb54/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e)](https://camo.githubusercontent.com/5caa455d8debc46fb23abbadb45a733a937f3910a73fc875c2f7820468e1bb54/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e)[![Status](https://camo.githubusercontent.com/f6b27b0945df41bb9b5a81e68b53688d16c8fca8f803d1a5902eac99dd7f77db/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5374617475732d50726f64756374696f6e25323052656164792d73756363657373)](https://camo.githubusercontent.com/f6b27b0945df41bb9b5a81e68b53688d16c8fca8f803d1a5902eac99dd7f77db/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5374617475732d50726f64756374696f6e25323052656164792d73756363657373)

BoxWhatsapp is a lightweight and developer-focused PHP package designed to simplify WhatsApp message delivery through the Unipile API.

Built for modern PHP environments, BoxWhatsapp helps developers, startups, SaaS platforms, CRMs, automation systems, AI tools, and enterprise applications integrate WhatsApp messaging with a clean and maintainable architecture.

BoxWhatsapp is part of the TheBox ecosystem.

---

Why BoxWhatsapp?
================

[](#why-boxwhatsapp)

Working directly with WhatsApp APIs can quickly become complex due to:

- authentication management
- account discovery
- attendee formatting
- multipart requests
- API response normalization
- endpoint changes
- provider-side updates
- error handling
- infrastructure compatibility

BoxWhatsapp abstracts these technical layers and provides a clean PHP-oriented interface focused on simplicity, stability, and production readiness.

---

Main Features
=============

[](#main-features)

- Send WhatsApp messages easily
- Send messages to multiple recipients
- Send messages to WhatsApp groups
- Automatic account discovery
- Unified API responses
- Lightweight architecture
- Compatible with modern PHP environments
- Production-ready structure
- PSR-4 autoloading support
- Easy integration into existing PHP projects

---

Installation
============

[](#installation)

Composer Installation
---------------------

[](#composer-installation)

```
composer require the-box/box-whatsapp
```

---

Manual Installation
-------------------

[](#manual-installation)

You can also include the package manually:

```
require "src/BoxWhatsapp.php";
```

---

Requirements
============

[](#requirements)

- PHP 7.4 or higher
- PHP cURL extension enabled
- Valid Unipile API key
- Active Unipile account
- Internet access

---

Enable cURL Extension
=====================

[](#enable-curl-extension)

Open your `php.ini` file and enable cURL:

```
extension=curl
```

Then restart your terminal or web server.

Verify installation:

```
php -m
```

You should see:

```
curl
```

---

Basic Configuration
===================

[](#basic-configuration)

```
use BoxWhatsapp\BoxWhatsapp;

$whatsapp = new BoxWhatsapp();

$whatsapp->setKey('YOUR_UNIPILE_API_KEY');
$whatsapp->setDns('https://your-api-host/api/v1');
$whatsapp->setAccountId('YOUR_ACCOUNT_ID');
```

---

Important About setDns()
========================

[](#important-about-setdns)

The `setDns()` method must contain the complete API base URL.

Correct example:

```
$whatsapp->setDns('https://your-domain.com/api/v1');
```

Incorrect example:

```
$whatsapp->setDns('your-domain');
```

A wrong DNS or incomplete API URL is one of the most common causes of:

```
HTTP 400
HTTP 401
HTTP 404

```

errors.

---

Quick Start
===========

[](#quick-start)

Send a Simple Message
---------------------

[](#send-a-simple-message)

```
