Download the PHP package fw4/whise-api without Composer
On this page you can find all versions of the php package fw4/whise-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fw4/whise-api
More information about fw4/whise-api
Files in fw4/whise-api
Informations about the package whise-api
Whise API
PHP client for the Whise API. For terms of use and API credentials, refer to the official documentation.
Installation
composer require fw4/whise-api
Usage
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
Use the following methods to access available endpoints:
Administration
Estates
Contacts
Calendars
Activity
Pagination
Endpoints that retrieve multiple items return a traversable list of objects. Pagination for large lists happens automatically.
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 onactivities
endpoints.getPageCount()
to retrieve the total amount of pages. This method is currently not available onactivities
endpoints.
Example
Caching
It's possible to enable caching by using a PSR-6 compatible cache adapter. Do note that this will cause all read operations to be cached, overriding any cache-control policy used by the Whise API, violating RFC.
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.
License
fw4/whise-api
is licensed under the MIT License (MIT). Please see LICENSE for more information.
All versions of whise-api with dependencies
guzzlehttp/guzzle Version ~6.0|~7.0
ocramius/package-versions Version ^2.1