1. Go to this page and download the library: Download housemates/connect-api library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
housemates / connect-api example snippets
$configuration = new \Housemates\ConnectApi\Configuration();
$configuration
->setAccessToken('b2fcrSRUV8OsN6Yn79UKGIiGDCLUJtGqEL3m2aO4')
->setApiPartnerId('01H0N04529EXND84J5AN2ZH7CX');
$connectApi = new Housemates\ConnectApi\ApiClient($configuration);
$filters = new \Housemates\ConnectApi\Filters\RoomFilter();
$filters->setPriceRangeFilter('[100,400]'); // Please note that the price range must be in the format [min,max]
try{
$results = $connectApi->getRooms($filters);
print_r($results->getData()->getItems());
} catch (\Exception $e) {
// Handle exception
}
$filters = new \Housemates\ConnectApi\Filters\RoomFilter();
$filters->setPriceRangeFilter('[100,400]'); // Please note that the price range must be in the format [min,max]
$sort = new \Housemates\ConnectApi\Sort();
$sort->setSortBy('price', 'asc');
try{
$results = $connectApi->getRooms($filters, $sort);
print_r($results->getData()->getItems());
} catch (\Exception $e) {
// Handle exception
}