PHPackages                             esolutions/ws - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. esolutions/ws

ActiveLibrary[HTTP &amp; Networking](/categories/http)

esolutions/ws
=============

HTTP client for WhatsApp API

v1.0.0(1mo ago)01proprietaryPHPPHP ^8.2

Since Jun 11Pushed 1mo agoCompare

[ Source](https://github.com/eriquegasparcarlos/esolutions-ws)[ Packagist](https://packagist.org/packages/esolutions/ws)[ RSS](/packages/esolutions-ws/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

esolutions/ws
=============

[](#esolutionsws)

Cliente HTTP para WhatsApp API. Envía mensajes de texto y documentos PDF, y gestiona sesiones.

Instalación
-----------

[](#instalación)

```
composer require esolutions/ws
```

Namespace
---------

[](#namespace)

```
Esolutions\Ws\

```

---

Configuración
-------------

[](#configuración)

Agregar en `config/esolutions.php`:

```
'ws' => [
    'url'   => env('WS_API_URL'),
    'token' => env('WS_API_TOKEN'),
],
```

Agregar en `.env`:

```
WS_API_URL=http://tu-servidor-whatsapp/api
WS_API_TOKEN=tu_token_aqui
```

---

Uso
---

[](#uso)

```
use Esolutions\Ws\Service as WhatsApp;
```

### Enviar PDF

[](#enviar-pdf)

Envía un archivo PDF como adjunto a un número de WhatsApp.

```
$pdfContent = file_get_contents('/ruta/al/archivo.pdf');

$result = WhatsApp::sendPdf(
    base64Pdf: base64_encode($pdfContent),
    number: '51987654321',
    message: 'Adjunto su comprobante de pago',
    filename: 'factura_F001-001.pdf'
);

// → ['success' => true, 'messageId' => 'abc123']
// → ['success' => false, 'message' => 'Sesión no disponible']
```

### Enviar texto

[](#enviar-texto)

```
$result = WhatsApp::sendText(
    sessionId: 'session-01',
    to: '51987654321',
    text: 'Su pedido fue confirmado. Gracias por su compra.'
);
```

### Listar sesiones

[](#listar-sesiones)

```
$sessions = WhatsApp::getSessions();

// → [
//     'success' => true,
//     'data' => [
//         ['id' => 'session-01', 'status' => 'connected'],
//         ['id' => 'session-02', 'status' => 'disconnected'],
//     ]
// ]
```

### Estado de una sesión

[](#estado-de-una-sesión)

```
$status = WhatsApp::getSessionStatus('session-01');

// → ['success' => true, 'data' => ['status' => 'connected']]
```

### Estado de entrega de un mensaje

[](#estado-de-entrega-de-un-mensaje)

```
$status = WhatsApp::getMessageStatus('abc123');

// → ['success' => true, 'data' => ['status' => 'delivered']]
```

---

Métodos
-------

[](#métodos)

MétodoTimeoutDescripción`sendPdf($base64, $number, $message, $filename)`30sEnvía un PDF como archivo adjunto`sendText($sessionId, $to, $text)`15sEnvía mensaje de texto plano`getSessions()`15sLista todas las sesiones disponibles`getSessionStatus($sessionId)`15sEstado de una sesión específica`getMessageStatus($messageId)`15sEstado de entrega de un mensaje---

Comportamiento
--------------

[](#comportamiento)

- Todos los métodos retornan `array` con `success` como clave principal.
- Los errores de red o de la API se capturan internamente — nunca lanza excepciones.
- SSL verify desactivado para compatibilidad con servidores locales/privados.
- Timeout de PDF es mayor (30s) porque el servidor puede tardar en procesar archivos grandes.

---

Formato del número
------------------

[](#formato-del-número)

El número de destino debe incluir el código de país sin `+`:

```
51987654321   ✅  Perú
1234567890    ❌  Sin código de país
+51987654321  ❌  Con símbolo +

```

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance90

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

46d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/57302658?v=4)[eriquegasparcarlos](/maintainers/eriquegasparcarlos)[@eriquegasparcarlos](https://github.com/eriquegasparcarlos)

---

Top Contributors

[![eriquegasparcarlos](https://avatars.githubusercontent.com/u/57302658?v=4)](https://github.com/eriquegasparcarlos "eriquegasparcarlos (5 commits)")

### Embed Badge

![Health badge](/badges/esolutions-ws/health.svg)

```
[![Health](https://phpackages.com/badges/esolutions-ws/health.svg)](https://phpackages.com/packages/esolutions-ws)
```

###  Alternatives

[api-platform/laravel

API Platform support for Laravel

58174.6k17](/packages/api-platform-laravel)[lomkit/laravel-rest-api

A package to build quick and robust rest api for the Laravel framework.

59463.6k](/packages/lomkit-laravel-rest-api)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k8](/packages/statamic-rad-pack-runway)[wirechat/wirechat

A Laravel Livewire messaging app for teams with private chats and group conversations.

56910.5k](/packages/wirechat-wirechat)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3518.3k](/packages/duncanmcclean-statamic-cargo)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
