Download the PHP package fw4/mason-api without Composer
On this page you can find all versions of the php package fw4/mason-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fw4/mason-api
More information about fw4/mason-api
Files in fw4/mason-api
Package mason-api
Short Description PHP library for implementing the Mason External API
License MIT
Informations about the package mason-api
Mason External API
PHP client for the Mason External API. For terms of use and request/response schema, refer to the official documentation.
Installation
This package requires PHP 8.4 or newer.
composer require fw4/mason-api
Usage
Available endpoints
Use the following methods to access available endpoints:
Estates
Previews
Offices
Webhook
Contact requests
Tokens
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 1), 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 1).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.getPageCount()to retrieve the total amount of pages.
Example
Configuration
The default base URL is https://dev-api.mason.immo/. It can be changed through the constructor:
The default page size is 25 and can be configured when creating the client:
Token storage
The client obtains new OAuth access tokens automatically when necessary. Tokens are kept in memory by default, though it is recommended to use persistent token storage instead.
To use persistent filesystem storage:
Native Redis storage requires the ext-redis PHP extension:
Any PSR-16 cache can be used with Psr16TokenStorage. Custom stores can implement
Mason\Api\Auth\TokenStorage\TokenStorageInterface.
License
fw4/mason-api is licensed under the MIT License (MIT). Please see LICENSE for more information.
All versions of mason-api with dependencies
guzzlehttp/guzzle Version ~7.0
psr/http-client Version ^1.0
psr/http-factory Version ^1.1
psr/http-message Version ^2.0
psr/simple-cache Version ^3.0