PHPackages                             wapilot/sdk - 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. wapilot/sdk

ActiveLibrary

wapilot/sdk
===========

Official PHP/Laravel SDK for WAPILOT.io - WhatsApp Business API Integration

00PHP

Since Sep 6Pushed 8mo agoCompare

[ Source](https://github.com/WAPILOT/wapilot-php-sdk)[ Packagist](https://packagist.org/packages/wapilot/sdk)[ RSS](/packages/wapilot-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

WAPILOT PHP/Laravel SDK
=======================

[](#wapilot-phplaravel-sdk)

Official PHP/Laravel SDK for WAPILOT.io - WhatsApp Business API Integration Platform

Overview
--------

[](#overview)

WAPILOT SDK provides a simple and intuitive way to integrate WhatsApp Business API functionality into your PHP/Laravel applications. This SDK handles all the complexity of API communication, authentication, and data formatting, allowing you to focus on building your application logic.

Features
--------

[](#features)

- 📱 **Contact Management** - Create, update, and manage WhatsApp contacts
- 👥 **Contact Groups** - Organize contacts into groups for better management
- 💬 **Message Sending** - Send text, media, and interactive messages
- 📝 **Templates** - Manage and send template messages
- 🤖 **Automated Replies** - Set up and manage automated responses
- ✨ **Modern Architecture** - Built with modern PHP 8.0+
- 🔒 **Secure** - Built-in token-based authentication and HTTPS
- 🚀 **Laravel Integration** - Seamless Laravel integration with Facade support

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require wapilot/sdk
```

### Laravel Setup

[](#laravel-setup)

1. The package will automatically register its service provider and facade.
2. Publish the configuration file:

```
php artisan vendor:publish --provider="Wapilot\SDK\WapilotServiceProvider"
```

3. Add your WAPILOT credentials to your `.env` file:

```
WAPILOT_API_TOKEN=your-api-token
WAPILOT_API_URL=https://app.wapilot.io  # Optional
```

Usage
-----

[](#usage)

### Laravel Usage (Recommended)

[](#laravel-usage-recommended)

Using the Facade:

```
use Wapilot\SDK\Facades\Wapilot;

// Send a message
$result = Wapilot::sendMessage([
    'phone' => '+1234567890',
    'message' => 'Hello from Laravel!'
]);
```

### Standalone PHP Usage

[](#standalone-php-usage)

```
use Wapilot\SDK\WapilotSDK;

$wapilot = new WapilotSDK('your-api-token');

// Send a message
try {
    $result = $wapilot->sendMessage([
        'phone' => '+1234567890',
        'message' => 'Hello from PHP!'
    ]);
    print_r($result);
} catch (\Exception $e) {
    echo 'Error: ' . $e->getMessage();
}
```

API Reference
-------------

[](#api-reference)

### Contact Management

[](#contact-management)

#### Get All Contacts

[](#get-all-contacts)

```
$contacts = Wapilot::getContacts();
```

#### Create Contact

[](#create-contact)

```
$newContact = Wapilot::createContact([
    'name' => 'John Doe',
    'phone' => '+1234567890',  // International format with country code
    'email' => 'john@example.com',  // Optional
    'notes' => 'VIP Customer'  // Optional
]);
```

#### Update Contact

[](#update-contact)

```
$updatedContact = Wapilot::updateContact('contact-uuid', [
    'name' => 'John Smith'
]);
```

#### Delete Contact

[](#delete-contact)

```
Wapilot::deleteContact('contact-uuid');
```

### Message Sending

[](#message-sending)

#### Send Text Message with Interactive Buttons

[](#send-text-message-with-interactive-buttons)

```
Wapilot::sendMessage([
    'phone' => '+1234567890',
    'message' => 'Hello! How can we help you today?',
    'header' => 'Welcome Message',  // Optional
    'footer' => 'Reply with a button',  // Optional
    'buttons' => [
        [
            'id' => 'support',
            'title' => 'Get Support'
        ],
        [
            'id' => 'sales',
            'title' => 'Sales Inquiry'
        ]
    ]
]);
```

#### Send Media Message

[](#send-media-message)

```
Wapilot::sendMediaMessage([
    'phone' => '+1234567890',
    'media_type' => 'image',  // 'image', 'video', 'document', 'audio'
    'media_url' => 'https://example.com/image.jpg',
    'caption' => 'Check out our new product!',  // Optional
    'file_name' => 'product.jpg'  // Required for documents
]);
```

#### Send Template Message

[](#send-template-message)

```
Wapilot::sendTemplateMessage([
    'phone' => '+1234567890',
    'template' => [
        'name' => 'appointment_reminder',
        'language' => [
            'code' => 'en'
        ],
        'components' => [
            [
                'type' => 'header',
                'parameters' => [
                    [
                        'type' => 'image',
                        'image' => [
                            'link' => 'https://example.com/appointment.jpg'
                        ]
                    ]
                ]
            ],
            [
                'type' => 'body',
                'parameters' => [
                    [
                        'type' => 'text',
                        'text' => 'John Doe'
                    ],
                    [
                        'type' => 'text',
                        'text' => '3:00 PM'
                    ]
                ]
            ]
        ]
    ]
]);
```

### Contact Groups

[](#contact-groups)

#### Get All Groups

[](#get-all-groups)

```
$groups = Wapilot::getContactGroups();
```

#### Create Group

[](#create-group)

```
$newGroup = Wapilot::createContactGroup([
    'name' => 'VIP Customers',
    'description' => 'Our premium customers'  // Optional
]);
```

#### Update Group

[](#update-group)

```
$updatedGroup = Wapilot::updateContactGroup('group-uuid', [
    'name' => 'Premium Customers'
]);
```

#### Delete Group

[](#delete-group)

```
Wapilot::deleteContactGroup('group-uuid');
```

### Automated Replies

[](#automated-replies)

#### Get All Automated Replies

[](#get-all-automated-replies)

```
$replies = Wapilot::getCannedReplies();
```

#### Create Automated Reply

[](#create-automated-reply)

```
$newReply = Wapilot::createCannedReply([
    'name' => 'Welcome Message',
    'message' => 'Thank you for contacting us! Our team will respond shortly.',
    'keywords' => ['hi', 'hello', 'hey']  // Optional trigger keywords
]);
```

#### Update Automated Reply

[](#update-automated-reply)

```
$updatedReply = Wapilot::updateCannedReply('reply-uuid', [
    'message' => 'Thank you for reaching out! We will get back to you soon.'
]);
```

#### Delete Automated Reply

[](#delete-automated-reply)

```
Wapilot::deleteCannedReply('reply-uuid');
```

### Templates

[](#templates)

#### Get All Templates

[](#get-all-templates)

```
$templates = Wapilot::getTemplates();
```

Error Handling
--------------

[](#error-handling)

The SDK uses PHP exceptions for error handling:

```
try {
    $contacts = Wapilot::getContacts();
} catch (\GuzzleHttp\Exception\ClientException $e) {
    // API Error (4xx response)
    echo 'API Error: ' . $e->getResponse()->getBody()->getContents();
    echo 'Status Code: ' . $e->getResponse()->getStatusCode();
} catch (\Exception $e) {
    // Other errors
    echo 'Error: ' . $e->getMessage();
}
```

Common Error Codes:

- 401: Invalid or expired API token
- 400: Invalid request parameters
- 404: Resource not found
- 429: Rate limit exceeded
- 500: Server error

Best Practices
--------------

[](#best-practices)

1. **Error Handling**: Always implement proper error handling using try/catch blocks
2. **Token Security**: Never expose your API token in client-side code
3. **Rate Limiting**: Implement proper rate limiting in your application
4. **Message Templates**: Use templates for recurring messages
5. **Contact Management**: Keep contact information up to date
6. **Testing**: Test your integration thoroughly in a development environment

Support
-------

[](#support)

For support or inquiries, please contact:

- Email:

License
-------

[](#license)

MIT License - feel free to use this SDK in your projects.

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance43

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/f978be65780c183327dc1bd9be77017104cab8aaf2474eebbfa48a6f22ffcf56?d=identicon)[wapilot](/maintainers/wapilot)

---

Top Contributors

[![Parag0712](https://avatars.githubusercontent.com/u/118881644?v=4)](https://github.com/Parag0712 "Parag0712 (1 commits)")

### Embed Badge

![Health badge](/badges/wapilot-sdk/health.svg)

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

PHPackages © 2026

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