Alto by Vebra

Setting up an import from Alto

This page contains information specific to Alto. For a general guide on setting up a property import, please see our 'Creating your first property import' guide.

When creating an import from Alto, you'll be presented with the following fields:

Username - You will need to obtain your Username directly from Alto.

Password - You will need to obtain your Password directly from Alto.

Note this isn't your username and password that you'd login to the Alto UI with. Alto will set you up a separate username and password specifically for use with the API.

Datafeed ID - You will need to obtain your Datafeed ID directly from Alto.

Only import updated properties - To ensure feeds run quicker and more efficiently you can tick this option to only import properties that have changed since the last time an import ran.

Developer hooks

Hook name: propertyhive_database_id_mappings_vebra_api_xml

Hook type: Action

Description: Executed after the properties are parsed but before they are actually imported.

Example usage:

add_action( 'propertyhive_database_id_mappings_vebra_api_xml', 'custom_db_ids', 10, 2 );
function custom_db_ids( $database_id_mappings, $import_id )
{
    // $database_id_mappings (array) - Array of database IDs from Alto and their corresponding department in Property Hive.
    // Default:
    /* array(
        '1' => 'residential-sales',
        '2' => 'residential-lettings',
        '5' => 'commercial',
        '15' => 'residential-sales'
    ) */
    // $import_id (int) - The ID of the import setup in Property Hive

    $database_id_mappings['3'] = 'residential-sales'; // 3 = France Residential Sales in Alto

    return $database_id_mappings;
}

Hook name: propertyhive_pre_import_properties_vebra_api_xml

Hook type: Action

Description: Executed after the properties are parsed but before they are actually imported.

Example usage:

add_action( 'propertyhive_pre_import_properties_vebra_api_xml', 'pre_import' );
function pre_import( $properties )
{
     // $properties (array) - Array of SimpleXML objects containing property data sent by Alto

    // do something here...
}

Hook name: propertyhive_vebra_api_xml_properties_due_import

Hook type: Filter

Description: Executed after the properties are parsed but before actually being imported. Allows you to filter out any properties you don't want to import.

For example, maybe you want to only import properties belonging to a certain office.

Example usage:

add_filter( 'propertyhive_vebra_api_xml_properties_due_import', 'filter_properties' );
function filter_properties( $properties )
{
    // $properties (array) - Array of SimpleXML objects containing property data sent by Alto

    $new_properties = array();
    
    foreach ($properties as $property)
    {
        $property_attributes = $property->attributes();
        
        if ( 
            isset($property_attributes['branchid']) && 
            (string)$property_attributes['branchid'] == '12345' 
        )
        {
            $new_properties[] = $property;
        }
    }
    return $new_properties;
}

Hook name: propertyhive_property_imported_vebra_api_xml

Hook type: Action

Description: Executed after each individual property is imported.

Example usage:

add_action( 'propertyhive_property_imported_vebra_api_xml', 'property_imported', 10, 2 );
function property_imported( $post_id, $property )
{
    // $post_id (int) - the WordPress post ID of the imported property
    // $property (SimpleXML object) - The property received from Alto

    // do something here...
}

Hook name: propertyhive_post_import_properties_vebra_api_xml

Hook type: Action

Description: Executed after all properties have been imported.

Example usage:

add_action( 'propertyhive_post_import_properties_vebra_api_xml', 'post_import' );
function post_import()
{
    // do something here...
}

Hook name: propertyhive_property_removed_vebra_api_xml

Hook type: Action

Description: Executed after a property has been removed from Property Hive due to it not being present in the feed.

Example usage:

add_action( 'propertyhive_property_removed_vebra_api_xml', 'property_removed' );
function property_removed( $post_id )
{
    // $post_id (int) - the WordPress post ID of the imported property

    // do something here...
}