PHPackages                             fw4/whise-api - 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. fw4/whise-api

ActiveLibrary[API Development](/categories/api)

fw4/whise-api
=============

PHP library for implementing the Whise API

v1.8.4(6mo ago)1311.4k↓62.7%10[1 issues](https://github.com/fw4-bvba/whise-api/issues)[1 PRs](https://github.com/fw4-bvba/whise-api/pulls)MITPHPPHP ^7.4 | ^8.0CI passing

Since Sep 18Pushed 6mo ago4 watchersCompare

[ Source](https://github.com/fw4-bvba/whise-api)[ Packagist](https://packagist.org/packages/fw4/whise-api)[ RSS](/packages/fw4-whise-api/feed)WikiDiscussions main Synced today

READMEChangelog (9)Dependencies (5)Versions (47)Used By (0)

Whise API
=========

[](#whise-api)

PHP client for the [Whise](https://www.whise.eu) API. For terms of use and API credentials, refer to the official documentation.

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

[](#installation)

`composer require fw4/whise-api`

Usage
-----

[](#usage)

```
use Whise\Api\WhiseApi;

$api = new WhiseApi();

// Retrieve existing access token from storage (getAccessTokenFromDataStore to be implemented)
$accessToken = getAccessTokenFromDataStore();

if (!$accessToken) {
    // Request and store new access token (saveAccessTokenToDataStore to be implemented)
    $accessToken = $api->requestAccessToken('username', 'password');
    saveAccessTokenToDataStore($accessToken);
}

$api->setAccessToken($accessToken);
```

All endpoints are provided as methods of the WhiseApi class. For more information about available endpoints and response format, refer to the official API documentation.

### Available endpoints

[](#available-endpoints)

Use the following methods to access available endpoints:

#### Administration

[](#administration)

```
$api->admin()->clients()->list($parameters);
$api->admin()->clients()->settings($parameters);
$api->admin()->clients()->updateSettings($parameters);
$api->admin()->clients()->token($parameters);
$api->admin()->offices()->list($parameters);
$api->admin()->representatives()->list($parameters);
```

#### Estates

[](#estates)

```
$api->estates()->list($filter, $sorting, $fields);
$api->estates()->get($id, $filter, $fields);
$api->estates()->regions()->list($parameters);
$api->estates()->usedCities()->list($filter);
$api->estates()->usedCountries()->list($filter);
$api->estates()->exports()->list($office_id, $parameters);
$api->estates()->exports()->changeStatus($estate_id, $export_status, $id_in_media, $export_message);
$api->estates()->owned()->list($username, $password, $filter, $sorting, $fields);
```

#### Contacts

[](#contacts)

```
$api->contacts()->upsert($parameters);
$api->contacts()->origins()->list($parameters);
$api->contacts()->titles()->list($parameters);
$api->contacts()->types()->list($parameters);
```

#### Calendars

[](#calendars)

```
$api->calendars()->list($filter, $sorting, $fields, $aggregation);
$api->calendars()->create($parameters);
$api->calendars()->delete($id);
$api->calendars()->update($parameters);
$api->calendars()->actions()->list($parameters);
```

#### Activity

[](#activity)

```
$api->activities()->calendars($filter, $aggregation);
$api->activities()->histories($filter, $aggregation);
$api->activities()->audits($filter, $aggregation);
$api->activities()->historyExports($filter, $aggregation);
```

### Pagination

[](#pagination)

Endpoints that retrieve multiple items return a traversable list of objects. Pagination for large lists happens automatically.

```
$estates = $api->estates()->list();

// Traversing over the response takes care of pagination in the background
foreach ($estates as $estate) {
    echo $estate->name . PHP_EOL;
}
```

### Manual pagination

[](#manual-pagination)

For situations where manual pagination is required, a `page` method is provided. Calling this method with both a desired page index (starting at 0), and the amount of items to retrieve per page, returns a traversable list of objects. This list also provides multiple methods for dealing with paging metadata:

- `getPage()` to retrieve the current page index (starting at 0).
- `getPageSize()` to retrieve the maximum amount of items per page.
- `count()` to retrieve the actual amount of items on the current page.
- `getTotalCount()` to retrieve the total amount of items across all pages. This method is currently not available on `activities` endpoints.
- `getPageCount()` to retrieve the total amount of pages. This method is currently not available on `activities` endpoints.

#### Example

[](#example)

```
$page_index = 2;
$items_per_page = 20;

$estates = $api->estates()->list([
    'CategoryIds' => [1]
]);
$page = $estates->page($page_index, $items_per_page);

echo 'Showing ' . $page->count() . ' items out of ' . $page->getTotalCount() . PHP_EOL;
echo 'Page ' . ($page->getPage() + 1) . ' of ' . $page->getPageCount() . PHP_EOL;
foreach ($page as $estate) {
    echo $estate->name . PHP_EOL;
}
```

### Caching

[](#caching)

It's possible to enable caching by using a [PSR-6 compatible cache adapter](https://www.php-fig.org/psr/psr-6/). Do note that this will cause all read operations to be cached, overriding any cache-control policy used by the Whise API, violating RFC.

```
use Cache\Adapter\Redis\RedisCachePool;

$redis = new \Redis();
$redis->connect('127.0.0.1', 6379);
$cache = new RedisCachePool($redis);

$api = new Whise\Api\WhiseApi($access_token);
$api->setCache($cache);
```

You can change the default cache lifetime of one hour, as well as the cache key prefix, by using the second and third parameters of `setCache` respectively. These can also be changed at runtime by using the `setCacheTtl` and `setCachePrefix` methods.

Responses are cached per access token, so make sure to reuse your access token to share a cache across script executions.

To determine whether a response was returned from cache, call the `isCacheHit` method. This method is not available when using automatic pagination.

```
$estate = $api->estates()->get(1);
if ($estate->isCacheHit()) {
    echo 'Response fetched from cache' . PHP_EOL;
} else {
    echo 'Response fetched from API' . PHP_EOL;
}
```

License
-------

[](#license)

`fw4/whise-api` is licensed under the MIT License (MIT). Please see [LICENSE](LICENSE) for more information.

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance64

Regular maintenance activity

Popularity35

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 88.3% 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 ~65 days

Recently: every ~173 days

Total

30

Last Release

208d ago

PHP version history (4 changes)1.0.0PHP ^7.1

1.3.0PHP ^7.4|^8.0

1.3.2PHP ^7.4|^8.0|^8.1

v1.8.4PHP ^7.4 | ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/2fe7a44c5e07cf8dd0eed2941b88dcab03342fb149ede5347b3467bc17691d4e?d=identicon)[Fyrts](/maintainers/Fyrts)

---

Top Contributors

[![fyrts](https://avatars.githubusercontent.com/u/5918336?v=4)](https://github.com/fyrts "fyrts (91 commits)")[![DeKerpelLaurent](https://avatars.githubusercontent.com/u/7040102?v=4)](https://github.com/DeKerpelLaurent "DeKerpelLaurent (9 commits)")[![tomsix](https://avatars.githubusercontent.com/u/60874146?v=4)](https://github.com/tomsix "tomsix (2 commits)")[![Nyl000](https://avatars.githubusercontent.com/u/857787?v=4)](https://github.com/Nyl000 "Nyl000 (1 commits)")

---

Tags

apisdkwhise

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/fw4-whise-api/health.svg)

```
[![Health](https://phpackages.com/badges/fw4-whise-api/health.svg)](https://phpackages.com/packages/fw4-whise-api)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k9.5M89](/packages/openai-php-laravel)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M45](/packages/tencentcloud-tencentcloud-sdk-php)[resend/resend-php

Resend PHP library.

617.2M43](/packages/resend-resend-php)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

563.6M13](/packages/checkout-checkout-sdk-php)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)

PHPackages © 2026

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