PHPackages                             rumahweb/whatsapp-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. rumahweb/whatsapp-sdk

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rumahweb/whatsapp-sdk
=====================

v0.0.1(1y ago)07MITPHPPHP ^7.4 || ^8.0

Since Jul 16Pushed 1y agoCompare

[ Source](https://github.com/rwaddin/whatsapp-sdk)[ Packagist](https://packagist.org/packages/rumahweb/whatsapp-sdk)[ RSS](/packages/rumahweb-whatsapp-sdk/feed)WikiDiscussions main Synced 1w ago

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

whatsapp-sdk
============

[](#whatsapp-sdk)

Whatsapp API SDK hanya untuk penggunaan keperluan perusahaan

Core concept
------------

[](#core-concept)

Penting untuk diketahui penggunaan sdk ini dipakai di end aplikasi, tidak menghandle langsung hook pada whatsapp.

```
1. Facebook akan mengirim WebHook ke gateway contoh gateway.domain.id
2. Gateway melakukan handshake dengan facebook terkait webhook apakah sesuai key atau tidak
3. Gateway meneruskan hook facebook ke end aplikasi contoh end.domain.id
4. end aplikasi inilah yang akan menggunakan sdk ini
```

Information
-----------

[](#information)

Ada beberapa type webhook yang dikirim oleh facebook

1. Message

    - text
    - image
    - sticker
    - documents
    - unknown (ex pesan tidak support)
    - button
2. Status

    - sent
    - delivered
    - read
    - failed

Features
--------

[](#features)

- Send text message
- Generate webhook message (bukan memvalidasi webhook facebook secara langsung)
- Send image message
- Send document message

Usage
-----

[](#usage)

- `$token` : Token facebook
- `$wabaId` : WhatsApp business account id

```
use Rumahweb\WhatsApp;

$whatsApp = WhatsApp::init($token);
```

### Message

[](#message)

```
$message = $whatsApp->message($wabaId);

# Text message
$message->sendText("6285747277xxx", "Hello World");
```

### Message Template

[](#message-template)

- `to` : nomor penerima
- `header` : header template (optional)
- `body` : body template (optional)

```
$params["to"] = "xxxx";
$params["header"] = [
  [
    "type" => "text",
    "text" => "pesan nya apa"
  ]
]
$params["body"] = [
  [
    "type" => "text",
    "text" => "pesan nya apa"
  ]
]

$template = $whatsApp->template($wabaId);
$template->send("nama_template", $params);
```

Pastikan index array di header dan body sama dengan template yang telah dibuat di facebook sesuai urutan variabel nya.

Ref: [disini](https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-message-templates#sample-request)

#### Contoh Response Success

[](#contoh-response-success)

```
Array
(
    [messaging_product] => whatsapp
    [contacts] => Array
        (
            [0] => Array
                (
                    [input] => +6285747277xxx
                    [wa_id] => 6285747277xxx
                )

        )

    [messages] => Array
        (
            [0] => Array
                (
                    [id] => wamid.HBgNNjI4NTc0NzI3NzQ2NhU
                    [message_status] => accepted
                )

        )

)
```

Hook
----

[](#hook)

hook contoh dibawah merupakah return dari method berikut:

```
$hook = ['array', 'data', 'from', 'facebook'];
$webhook = new Rumahweb\Webhook($hook);
print_r($hook);
```

Keterangan :

- `phone_display` : Nomor hp whatsapp
- `phone_id` : Phone number id device whatsapp
- `hook_type` : saat ini hanya ada 2 (`message` &amp; `status`)
- `wamid` : WhatsApp message ID

### Message type

[](#message-type)

Text message

```
{
  "phone_display": "1234567890",
  "phone_id": "987654321",
  "hook_type": "message",
  "from_name": "addin",
  "from_phone": "6285747277xxx",
  "wamid": "wamid.HBgNNjI4NTxxxxxx",
  "timestamp": "1746604743",
  "type": "text",
  "text": "Halo ini pesan dari addin"
}
```

### Status Type

[](#status-type)

- `recipient_phone` : penerima message

Status Delivered

```
{
  "phone_display": "1234567890",
  "phone_id": "987654321",
  "hook_type": "status",
  "wamid": "wamid.HBgNNxxxx",
  "status": "delivered",
  "timestamp": "1746595471",
  "recipient_phone": "6285747277xxx"
}
```

Status sent

```
{
  "phone_display": "1234567890",
  "phone_id": "987654321",
  "hook_type": "status",
  "wamid": "wamid.HBgNNjIxx",
  "status": "sent",
  "timestamp": "1752630521",
  "recipient_phone": "6285747277xxx"
}
```

Status Failed

```
{
  "phone_display": "1234567890",
  "phone_id": "987654321",
  "hook_type": "status",
  "wamid": "wamid.HBgNxx",
  "status": "failed",
  "timestamp": "1752629020",
  "recipient_phone": "6285747277xxx"
}
```

Status Read

```
{
  "phone_display": "1234567890",
  "phone_id": "987654321",
  "hook_type": "status",
  "wamid": "wamid.HBgNNjxx",
  "status": "read",
  "timestamp": "1752630698",
  "recipient_phone": "6285747277xxx"
}
```

Example error
-------------

[](#example-error)

```
Array
(
    [error] => Array
        (
            [message] => Invalid OAuth access token - Cannot parse access token
            [type] => OAuthException
            [code] => 190
            [fbtrace_id] => AtYQl3mJPwLPhH-m_buoHAI
        )

)
```

```
Array
(
    [error] => Array
        (
            [message] => (#132001) Template name does not exist in the translation
            [type] => OAuthException
            [code] => 132001
            [error_data] => Array
                (
                    [messaging_product] => whatsapp
                    [details] => template name (event_reminder3) does not exist in id_ID
                )

            [fbtrace_id] => AGSJexhOhNweWMeFsVy4y05
        )

)
```

###  Health Score

24

—

LowBetter than 30% of packages

Maintenance47

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity33

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

Unknown

Total

1

Last Release

399d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6179522?v=4)[Juan Pablo Romero Mendoza](/maintainers/addin)[@Addin](https://github.com/Addin)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k832.6k55](/packages/neuron-core-neuron-ai)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

762297.9k53](/packages/civicrm-civicrm-core)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.3M49](/packages/tencentcloud-tencentcloud-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

353.6k](/packages/eslazarev-wildberries-sdk)[oat-sa/tao-core

TAO core extension

64147.9k151](/packages/oat-sa-tao-core)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

265.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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