epse / miep-php-api-client
Max-immo 外部合作伙伴 API 客户端
1.2.0
2021-02-17 10:04 UTC
Requires
- php: >=7.3
- beberlei/assert: ^2.9
- php-http/client-implementation: ^1.0
- php-http/httplug: ^1.1
- php-http/message: ^1.11
- shrikeh/teapot: ^2.3
Requires (Dev)
- php-http/guzzle6-adapter: ^1.1
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.5
This package is auto-updated.
Last update: 2024-09-17 18:11:33 UTC
README
安装
获取您首选的 HTTP 客户端实现
使用以下命令安装最新版本
$ composer require zimmobe/miep-php-api-client
用法
use MaxImmo\ExternalParties\MiepClient; use MaxImmo\ExternalParties\Client; use MaxImmo\ExternalParties\JsonResponseEvaluator; use Http\Client\HttpClient; use Http\Message\MessageFactory; $httpClient = new HttpClient(); // Implementation of Interface $messageFactory = new MessageFactory(); // Implementation of Interface $responseEvaluator = new JsonResponseEvaluator(); $apiClient = new Client($httpClient, $messageFactory, $responseEvaluator); $miepClient = new MiepClient('client_id', 'client_secret', $apiClient);
更多信息: PHP-HTTP
Guzzle 示例
use GuzzleHttp\Client as GuzzleClient; use Http\Adapter\Guzzle6\Client as HttpClient; use Http\Message\MessageFactory\GuzzleMessageFactory as MessageFactory; use MaxImmo\ExternalParties\Client; use MaxImmo\ExternalParties\JsonResponseEvaluator; use MaxImmo\ExternalParties\MiepClient; $httpClient = new HttpClient(new GuzzleClient(['base_uri' => 'https://ep.max-immo.be'])); $messageFactory = new MessageFactory(); $responseEvaluator = new JsonResponseEvaluator(); $apiClient = new Client($httpClient, $messageFactory, $responseEvaluator); $miepClient = new MiepClient('client_id', 'client_secret', $apiClient);
获取可用经纪人的列表
$miepClient->getBrokers();
获取指定经纪人的信息
$miepClient->getInformationForBroker('brokerId');
注意:经纪人 ID 是经纪人 MaxImmo URL 的子域名。此经纪人 ID 将在前述可用经纪人列表中提供。
获取经纪人的房地产信息
$miepClient->getRealEstateListForBroker('brokerId');
注意:经纪人 ID 是经纪人 MaxImmo URL 的子域名。此经纪人 ID 将在前述可用经纪人列表中提供。
获取经纪人的房产信息
$miepClient->getPropertyForBroker('brokerId', 'propertyId');
注意
- brokerId 是经纪人 MaxImmo URL 的子域名。此经纪人 ID 将在前述可用经纪人列表中提供。
- propertyId 是 Max-immo 房产 ID。此房产 ID 将在前述可用房地产列表中提供。
获取经纪人的项目
$miepClient->getProjectForBroker('brokerId', 'projectId');
注意
- brokerId 是经纪人 MaxImmo URL 的子域名。此经纪人 ID 将在前述可用经纪人列表中提供。
- projectId 是 Max-immo 房产 ID。此项目 ID 将在前述可用房地产列表中提供。
版本控制
此库将遵循经典的 semver 版本控制。主分支将始终跟随最新发布版本。
对此库核心的更改和新增功能,将尽力合并到以前的版本中。
许可
MIT 许可证 (MIT)。有关更多信息,请参阅 许可文件。