epse/miep-php-api-client

Max-immo External Partners API Client

1.2.0 2021-02-17 10:04 UTC

This package is auto-updated.

Last update: 2024-04-17 17:08:06 UTC


README

Build Status

Installation

Get your preferred HTTP Client implementation

install the latest version with

$ composer require zimmobe/miep-php-api-client

Usage

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);

More info: PHP-HTTP

Guzzle example

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);

Get list of available Brokers

$miepClient->getBrokers();

Get information for given Broker

$miepClient->getInformationForBroker('brokerId');

Note: Broker ID is the sub-domain of the broker's MaxImmo URL. This Broker ID will be provided in the list of available brokers discussed earlier.

Get Real Estate for Broker

$miepClient->getRealEstateListForBroker('brokerId');

Note: Broker ID is the sub-domain of the broker's MaxImmo URL. This Broker ID will be provided in the list of available brokers discussed earlier.

Get property for Broker

$miepClient->getPropertyForBroker('brokerId', 'propertyId');

Note:

  • brokerId is the sub-domain of the broker's MaxImmo URL. This Broker ID will be provided in the list of available brokers discussed earlier.
  • propertyId is the Max-immo property id. This Property ID will be provided in the list of available Real Estate discussed earlier.

Get project for broker

$miepClient->getProjectForBroker('brokerId', 'projectId');

Note:

  • brokerId is the sub-domain of the broker's MaxImmo URL. This Broker ID will be provided in the list of available brokers discussed earlier.
  • projectId is the Max-immo property id. This Project ID will be provided in the list of available Real Estate discussed earlier.

Versioning

This library will follow the classic semver versioning. The master branch will always follow the latest release.

Changes on the core of this library and added features, will be merged back to previous versions on a best effort basis.

License

The MIT License (MIT). Please see License File for more information.