PHPackages                             ay4t/php-watzap-id - 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. [API Development](/categories/api)
4. /
5. ay4t/php-watzap-id

ActiveLibrary[API Development](/categories/api)

ay4t/php-watzap-id
==================

PHP REST Client for Watzap.id API Integration

v1.0.1(1y ago)00MITPHP

Since Mar 11Pushed 1y ago1 watchersCompare

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

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

📱 PHP Watzap.id Client
======================

[](#-php-watzapid-client)

Library PHP untuk integrasi dengan layanan Watzap.id API. Dibuat dengan menggunakan [ay4t/php-rest-client](https://github.com/ay4t/php-rest-client) untuk penanganan HTTP request yang lebih baik.

🚀 Fitur Utama
-------------

[](#-fitur-utama)

- ✨ Integrasi mudah dengan Watzap.id API
- 🔄 Retry otomatis untuk request yang gagal
- 📝 Sistem logging yang lengkap
- ⚡ Penanganan error yang komprehensif
- 🔒 Konfigurasi yang fleksibel

📦 Instalasi
-----------

[](#-instalasi)

Install melalui Composer:

```
composer require ay4t/php-watzap-id
```

⚙️ Konfigurasi
--------------

[](#️-konfigurasi)

1. Buat file `.env` di root project Anda:

```
API_KEY=your_api_key_here
NUMBER_KEY=your_number_key_here
```

2. Load konfigurasi dalam kode PHP Anda:

```
use Dotenv\Dotenv;
use Ay4t\WatzapId\Config\WatzapConfig;
use Ay4t\WatzapId\WatzapClient;

// Load environment variables
$dotenv = Dotenv::createImmutable(__DIR__);
$dotenv->load();

// Inisialisasi konfigurasi
$config = new WatzapConfig();
$config->setApiKey($_ENV['API_KEY'])
       ->setNumberKey($_ENV['NUMBER_KEY']);

// Buat instance WatzapClient
$watzap = new WatzapClient($config);
```

📚 Penggunaan
------------

[](#-penggunaan)

### 🔍 Cek Status API

[](#-cek-status-api)

```
try {
    $status = $watzap->checkApiStatus();
    print_r($status);
} catch (ApiException $e) {
    echo "Error: " . $e->getMessage();
}
```

### ✅ Validasi Nomor WhatsApp

[](#-validasi-nomor-whatsapp)

```
try {
    $validation = $watzap->validateNumber('628123456789');
    print_r($validation);
} catch (ApiException $e) {
    echo "Error: " . $e->getMessage();
}
```

### 💬 Kirim Pesan Teks

[](#-kirim-pesan-teks)

```
try {
    $message = $watzap->sendMessage(
        '628123456789',
        'Halo! Ini adalah pesan dari WatzapClient.',
        true // tunggu sampai pesan terkirim
    );
    print_r($message);
} catch (ApiException $e) {
    echo "Error: " . $e->getMessage();
}
```

### 🖼️ Kirim Gambar dengan Caption

[](#️-kirim-gambar-dengan-caption)

```
try {
    $imageMessage = $watzap->sendImage(
        '628123456789',
        'https://example.com/image.jpg',
        'Caption untuk gambar'
    );
    print_r($imageMessage);
} catch (ApiException $e) {
    echo "Error: " . $e->getMessage();
}
```

### 👥 Fitur Grup

[](#-fitur-grup)

```
// Ambil daftar grup
try {
    $groups = $watzap->getGroups();
    print_r($groups);
} catch (ApiException $e) {
    echo "Error: " . $e->getMessage();
}

// Kirim pesan ke grup
try {
    $groupMessage = $watzap->sendGroupMessage(
        'GROUP-ID@g.us',
        'Halo semua! Ini adalah pesan grup.'
    );
    print_r($groupMessage);
} catch (ApiException $e) {
    echo "Error: " . $e->getMessage();
}

// Kirim gambar ke grup
try {
    $groupImage = $watzap->sendGroupImage(
        'GROUP-ID@g.us',
        'https://example.com/image.jpg',
        'Caption untuk gambar grup'
    );
    print_r($groupImage);
} catch (ApiException $e) {
    echo "Error: " . $e->getMessage();
}
```

🛠️ Penanganan Error
-------------------

[](#️-penanganan-error)

Library ini menggunakan sistem exception untuk menangani error. Semua error akan melempar `ApiException` yang menyediakan informasi detail:

```
try {
    $response = $watzap->sendMessage('628123456789', 'Pesan');
} catch (ApiException $e) {
    echo "Error Message: " . $e->getMessage() . "\n";
    echo "HTTP Status: " . $e->getHttpStatusCode() . "\n";
    echo "Response Body: " . $e->getResponseBody() . "\n";
}
```

📋 Persyaratan
-------------

[](#-persyaratan)

- PHP &gt;= 7.4
- Ekstensi PHP Curl
- Akun aktif di [Watzap.id](https://watzap.id)
- API Key dan Number Key dari Watzap.id

🤝 Kontribusi
------------

[](#-kontribusi)

Kontribusi sangat diterima! Silakan buat pull request untuk:

- 🐛 Perbaikan bug
- ✨ Fitur baru
- 📚 Perbaikan dokumentasi
- ⚡ Peningkatan performa

📄 Lisensi
---------

[](#-lisensi)

Project ini dilisensikan di bawah [MIT License](LICENSE).

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance51

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

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.

###  Release Activity

Cadence

Every ~36 days

Total

2

Last Release

387d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/831d350ec997ddc3e9d8958a40ec26668688d9120b9a4be362b5f5aa822e264f?d=identicon)[ay4t](/maintainers/ay4t)

---

Top Contributors

[![ay4t](https://avatars.githubusercontent.com/u/87152520?v=4)](https://github.com/ay4t "ay4t (3 commits)")

---

Tags

apilibraryphpwatzapwatzap-idwhatsappwhatsapp-api

### Embed Badge

![Health badge](/badges/ay4t-php-watzap-id/health.svg)

```
[![Health](https://phpackages.com/badges/ay4t-php-watzap-id/health.svg)](https://phpackages.com/packages/ay4t-php-watzap-id)
```

###  Alternatives

[netflie/whatsapp-cloud-api

The first PHP SDK to send and receive messages using a cloud-hosted version of the WhatsApp Business Platform

640431.7k4](/packages/netflie-whatsapp-cloud-api)[showdoc/showdoc

ShowDoc is a tool greatly applicable for an IT team to share documents online

12.8k7.0k](/packages/showdoc-showdoc)[wrav/oembed

A simple plugin to extract media information from websites, like youtube videos, twitter statuses or blog articles.

36205.0k3](/packages/wrav-oembed)[lucianotonet/groq-php

A powerful PHP library for seamless integration with the GroqCloud API

83124.5k6](/packages/lucianotonet-groq-php)[jasara/php-amzn-selling-partner-api

A fluent interface for Amazon's Selling Partner API in PHP

1344.8k1](/packages/jasara-php-amzn-selling-partner-api)[unicodeveloper/jusibe-php-lib

Jusibe PHP Library

3417.4k1](/packages/unicodeveloper-jusibe-php-lib)

PHPackages © 2026

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