1. Go to this page and download the library: Download topbroker/topbroker-php 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/ */
topbroker / topbroker-php example snippets
use TopBroker\TopBrokerApi;
$topbroker = new TopBrokerApi('<insert_api_username_token_here>', '<insert_api_password_token_here>');
/** Get Estate List */
$topbroker->estates->getList([]);
/** Get Estate List Flat and Houses,
* Minimum 50 sq. m area, sort by price from highest to lowest */
$topbroker->estates->getList([
'estate_type' => ['house', 'flat'],
'area_min' => 50,
'sort_by' => 'price', 'sort_to' => 'desc',
'per_page' => 10, 'page' => 1 ]);
/** Get Estate List By Custom Field */
$topbroker->estates->getList(['custom_fields' => [
'c_f_e_zymos' => ['Discounted', 'Top']]
]);
/** List of cities located in specific municipality */
$topbroker->locations->getCities(['municipality_id' => 123]);
/** List of districts located in specific city */
$topbroker->locations->getBlocks(['city_id' => 123]);
/** List of street located in specific city, containing Flat type estates and minimum price 100K */
$topbroker->locations->getStreets([
'city_id' => 123, 'for_sale ' => true,
'price_to' => 100000, 'estate_type' => ['flat']
]);
$topbroker->locations->getList([]);
$topbroker->locations->getItem(1234);
/** Get Contact List */
$topbroker->contacts->getList([]);
/** Get Contact List By User ID */
$topbroker->contacts->getList(['user_id' => 123]);
/** Get Contact List By Custom Field */
$topbroker->contacts->getList(['custom_fields' => [
'c_f_c_company_name' => 'Company XYZ',
'c_f_c_company_size' => '5-10']
]);
/** Get Contact List */
$topbroker->inquiries->getList([]);
/** Get Contact List By User ID */
$topbroker->inquiries->getList(['user_id' => 123]);
/** Get Contact List By Custom Field */
$topbroker->inquiries->getList(['custom_fields' => [
'c_f_i_special_needs' => 'Disco ball']
]);