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

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

waaltcom/whatools-php
=====================

PHP lib for integrating Whatools into your app easily.

02[1 issues](https://github.com/waalt/whatools-php/issues)PHP

Since Sep 22Pushed 10y ago4 watchersCompare

[ Source](https://github.com/waalt/whatools-php)[ Packagist](https://packagist.org/packages/waaltcom/whatools-php)[ RSS](/packages/waaltcom-whatools-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

whatools-php
============

[](#whatools-php)

PHP lib for integrating Whatools into your app easily

Notice
======

[](#notice)

This lib works only with v3 API. Please make sure your Whatools line is configured to use such API version.

API reference
=============

[](#api-reference)

Setting up
----------

[](#setting-up)

The only thing you need is including this library and then create an API object by passing your Whatools API key as a parameter to the class constructor.

```
include("whatools.inc.php");
$w = new Whatools("Put here your API key");
```

Remember that you can get the API key for your Whatools line by logging into Whatools and then going to `Advanced settings > REST API`.

Logging in and out
------------------

[](#logging-in-and-out)

Logging in and out is the analog process in v3 API to subscribing and unsubscribing in older API versions. Nevertheless, in v3, when you log out you are effectively closing the connection between WhatsApp servers and your account, so you can be sure that you never miss a single message.

```
$w->login();
echo "Logged in as +", $w->whatsappInfo->cc, $w->whatsappInfo->pn, "\n";
$w->logout();
```

Setting your nickname
---------------------

[](#setting-your-nickname)

```
$w->nicknamePost("John Doe");
```

Getting your nickname
---------------------

[](#getting-your-nickname)

```
$nickname = $w->nicknameGet("John Doe");
```

Setting your status message
---------------------------

[](#setting-your-status-message)

```
$w->statusPost("To be, or not to be, that is the question.");
```

Getting your status message
---------------------------

[](#getting-your-status-message)

```
$status = $w->statusGet();
```

Setting your avatar
-------------------

[](#setting-your-avatar)

```
$w->avatarPost("Route for an image file");
```

Getting and storing someone's avatar
------------------------------------

[](#getting-and-storing-someones-avatar)

```
$avatar = $w->avatarGet("Phone number in international format");
file_put_contents("avatar.jpg", $avatar);
```

Sending a message
-----------------

[](#sending-a-message)

```
$w->messagePost("Phone number in international format", "Body of the message");
```

Sending a picture
-----------------

[](#sending-a-picture)

```
$w->picturePost("Phone number in international format", "Route for an image file", "Optional caption");
```

Retrieving and printing messages received and sent since last logout
--------------------------------------------------------------------

[](#retrieving-and-printing-messages-received-and-sent-since-last-logout)

```
$messages = $w->messageGet();
foreach ($messages as $message)
{
  if ($msg->mine)
    echo "> ", $msg->to;
  else
    echo "< ", $msg->from;
  echo "\n\t\"", $msg->body, "\"";
  echo "\n\t@", $msg->stamp;
  echo "\n\tACK: ", $msg->ack, "\n";
}
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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/1fb05fd908a7c0a8319c672d086740e044524eeae3ae50bd3e8b0e81568bc29a?d=identicon)[aesedepece](/maintainers/aesedepece)

### Embed Badge

![Health badge](/badges/waaltcom-whatools-php/health.svg)

```
[![Health](https://phpackages.com/badges/waaltcom-whatools-php/health.svg)](https://phpackages.com/packages/waaltcom-whatools-php)
```

PHPackages © 2026

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