PHPackages                             inisiatif/whatsapp-qontak-php - 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. inisiatif/whatsapp-qontak-php

ActiveLibrary

inisiatif/whatsapp-qontak-php
=============================

Sending WhatsApp message using Qontak

1.4.1(4mo ago)510.0k↓43.3%8[2 PRs](https://github.com/atInisiatifZakat/whatsapp-qontak-php/pulls)1MITPHPPHP ^8.0CI passing

Since Sep 14Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/atInisiatifZakat/whatsapp-qontak-php)[ Packagist](https://packagist.org/packages/inisiatif/whatsapp-qontak-php)[ RSS](/packages/inisiatif-whatsapp-qontak-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (10)Versions (11)Used By (1)

WhatsApp Qontak API
===================

[](#whatsapp-qontak-api)

Sending WhatsApp message via Qontak API, using [HTTPlug](https://github.com/php-http/httplug).

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

[](#installation)

First install HTTPlug [adapter or client](https://docs.php-http.org/en/latest/clients.html)and PSR-17 package compatible

```
composer require php-http/curl-client laminas/laminas-diactoros
```

and then install this package :

```
composer require inisiatif/whatsapp-qontak-php
```

Usage
-----

[](#usage)

### Non framework usage

[](#non-framework-usage)

First your must be created a valid and approved WhatsApp template.

```
use Inisiatif\WhatsappQontakPhp\Client;
use Inisiatif\WhatsappQontakPhp\Credential;
use Inisiatif\WhatsappQontakPhp\Message\Body;
use Inisiatif\WhatsappQontakPhp\Message\Button;
use Inisiatif\WhatsappQontakPhp\Message\Header;
use Inisiatif\WhatsappQontakPhp\Message\Message;
use Inisiatif\WhatsappQontakPhp\Message\Receiver;
use Inisiatif\WhatsappQontakPhp\Message\Language;

$credentials = new Credential('username', 'password', 'clientId', 'clientSecret');

$client = new Client($credentials);

// Create message receiver
$receiver = new Receiver('+6281318788271', 'Nuradiyana');

// [Optional] Create language, supported 'en' and 'id', default is 'id'
$language = new Language('id');

// [Optional] Create params message body
$body = [
    new Body('Nuradiyana'),
    new Body('Gorengan'),
];

// [Optional] Create header message, support "DOCUMENT", "VIDEO", "IMAGE"
$header = new Header(
    Header::TYPE_DOCUMENT, 'https://example.com/link-to-file-url.pdf', 'file-name.pdf'
);

// [Optional] Create buttons
$buttons = [new Button('url', 'https://example.com')];

$message = new Message($receiver, $language, $body, $header, $buttons);
$response = $client->send('templateId', 'channelId', $message);

// Message Id and Receiver Name
echo $response->getMessageId();
echo $response->getName();

// All raw data
\var_dump($response->getData());
```

### Using in Laravel as Notification Channel

[](#using-in-laravel-as-notification-channel)

1. Add new config value in `config/services.php` and then setting each value in `.env`

```
'qontak' => [
    'username' => env('QONTAK_USERNAME', null),
    'password' => env('QONTAK_PASSWORD', null),
    'client_id' => env('QONTAK_CLIENT_ID', null),
    'client_secret' => env('QONTAK_CLIENT_SECRET', null),
],
```

2. Add this code in `register` method `AppServiceProvider`

```
$this->app->singleton(\Inisiatif\WhatsappQontakPhp\ClientInterface::class, function () {
    return $this->app->runningUnitTests() ? \Inisiatif\WhatsappQontakPhp\ClientFactory::makeTestingClient() :  \Inisiatif\WhatsappQontakPhp\ClientFactory::makeFromArray(
        config('service.qontak')
    );
});
```

3. Then create or register `ContakChannel` in notification class

```
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Inisiatif\WhatsappQontakPhp\Message\Message;
use Inisiatif\WhatsappQontakPhp\Message\Receiver;
use Inisiatif\WhatsappQontakPhp\Illuminate\Envelope;
use Inisiatif\WhatsappQontakPhp\Illuminate\QontakChannel;
use Inisiatif\WhatsappQontakPhp\Illuminate\QontakNotification;

class InvoicePaid extends Notification implements QontakNotification
{
    use Queueable;

    public function via($notifiable): array
    {
        return [QontakChannel::class];
    }

    public function toQontak($notifiable): Envelope
    {
        // First create message object
        $receiver = new Receiver('+6281318788271', 'Nuradiyana');
        $message = new Message($receiver);

        // Then create envelope object and return it
        return new Envelope('templateId', 'channelId', $message);
    }
}
```

Testing
-------

[](#testing)

🧹 Fixing codebase with **Easy Coding Standard**:

```
composer ecs
```

⚗️ Run static analysis using **Psalm**:

```
composer psalm
```

🚀 Run the entire test suite:

```
composer test
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance82

Actively maintained with recent releases

Popularity33

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 57.6% 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 ~151 days

Recently: every ~224 days

Total

9

Last Release

132d ago

PHP version history (2 changes)1.0PHP ^7.1 || ^8.0

1.3.1PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3500d4ed2061891d54f54b550fbb9e782d0d1838b7fee429578a0733b0a378bf?d=identicon)[NoorAdiana](/maintainers/NoorAdiana)

---

Top Contributors

[![nuradiyana](https://avatars.githubusercontent.com/u/1073802?v=4)](https://github.com/nuradiyana "nuradiyana (34 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (13 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (6 commits)")[![ihsanfikri12](https://avatars.githubusercontent.com/u/37237377?v=4)](https://github.com/ihsanfikri12 "ihsanfikri12 (4 commits)")[![nandi-ir](https://avatars.githubusercontent.com/u/83169406?v=4)](https://github.com/nandi-ir "nandi-ir (1 commits)")[![SupianIDz](https://avatars.githubusercontent.com/u/37969970?v=4)](https://github.com/SupianIDz "SupianIDz (1 commits)")

---

Tags

qontakwhatsappwhatsapp-api

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StyleECS

Type Coverage Yes

### Embed Badge

![Health badge](/badges/inisiatif-whatsapp-qontak-php/health.svg)

```
[![Health](https://phpackages.com/badges/inisiatif-whatsapp-qontak-php/health.svg)](https://phpackages.com/packages/inisiatif-whatsapp-qontak-php)
```

###  Alternatives

[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[mailgun/mailgun-php

The Mailgun SDK provides methods for all API functions.

1.1k28.9M168](/packages/mailgun-mailgun-php)[danog/madelineproto

Async PHP client API for the telegram MTProto protocol.

3.4k855.0k18](/packages/danog-madelineproto)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[friendsofsymfony/http-cache

Tools to manage HTTP caching proxies with PHP

36114.7M36](/packages/friendsofsymfony-http-cache)

PHPackages © 2026

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