Simple client to interact with trovimap evaluation API
use Trovimap\Propertista\TrovimapPhpClient\TrovimapFactory;
$client = TrovimapFactory::create();
$address = 'Passatge Escudellers, 7, 08002, Barcelona';
$parcels = $client->getParcelByAddress($address);
$buildingUnits = $client->getBuildingUnitByParcelId($parcel->Id);
1.2 get the list of the building units of the parcel that contains the apartments with the cadastral reference passed
$cadastralReference = '1213625DF3811C0009ZX';
$buildingUnits = $client->getBuildingUnitByCadastralReference($cadastralReference);
Now out of the buildingUnits retrieved above, we should be able to retrieve data of one Apartment from it's ID
use Trovimap\Propertista\TrovimapPhpClient\Models\Request\EvaluationRequest;
$apartmentId = 'asdfasdfasdfasdf';
$request = new EvaluationRequest([
'ApartmentId' => '8_900_1213625DF3811C_001_10',
'ParcelId' => '8_900_1213625DF3811C_0001',
'LivingArea' => 165,
]);
$data = $client->evaluate($apartmentId, $request);
$client->download('buildingUnitId', '/path/to/download/folder');