User Tools

Site Tools


en:public:developer:template_system:tags:api:get_geoplaces

Table of Contents

<#get_geoplaces>

Use this function to retrieve list of geo places according to a request

Parameters

Parameters are taken from tag (default) or from HTTP GET/Post

Name Mandatory Default Description
fields No geoplace.id
geoplace.translations[<#language>].label
The list of fields (separated by ”;”) you want to retrieve. The Name of the field must match the TGeoPlace structure. ex: fields=GeoPlace.id; Geoplace.label; GeoPlace.translations[fra].label_ascii; geoplace.zip_codes
GeoPlaceRequest.* No The filter list that match the TGeoPlaceRequest structure. Ex. GeoPlaceRequest.ID_parents[0]=FR GeoPlaceRequest.keywords=cannes
output_format No REST JSON to retrieve response in JSON Format or REST to retrieve in REST Format
jsoncallback No Callback function to use in JSON Response Format

Example

<#get_geoplaces output_format="json"
                geoplacerequest.id_parents[0]="XW"
                fields="geoplace.id;geoplace.havechilds;geoplace.label;geoplace.translations[rus].label;geoplace.translations[rus].propertylistings_url(1,1);geoplace.aggregated_data.properties_count(1,1)">

will output in JSON

{
    "stat": "ok",
    "geoplaces": [
        {
            "aggregated_data": {
                "properties_count": 278973
            },
            "havechilds": true,
            "id": 901,
            "label": "North and Central America",
            "translations": {
                "rus": {
                    "label": "Северная и Центральная Америка",
                    "propertylistings_url": "/for-sale/north-and-central-america/listings/"
                }
            }
        },
        {
            "aggregated_data": {
                "properties_count": 876
            },
            "havechilds": true,
            "id": 902,
            "label": "South America",
            "translations": {
                "rus": {
                    "label": "Южная Америка",
                    "propertylistings_url": "/for-sale/south-america/listings/"
                }
            }
        },
        {
            "aggregated_data": {
                "properties_count": 783322
            },
            "havechilds": true,
            "id": 903,
            "label": "Europe",
            "translations": {
                "rus": {
                    "label": "Европа",
                    "propertylistings_url": "/for-sale/europe/listings/"
                }
            }
        },
        {
            "aggregated_data": {
                "properties_count": 41018
            },
            "havechilds": true,
            "id": 904,
            "label": "Asia",
            "translations": {
                "rus": {
                    "label": "Азия",
                    "propertylistings_url": "/for-sale/asia/listings/"
                }
            }
        },
        {
            "aggregated_data": {
                "properties_count": 144
            },
            "havechilds": true,
            "id": 905,
            "label": "Oceania",
            "translations": {
                "rus": {
                    "label": "Океания",
                    "propertylistings_url": "/for-sale/oceania/listings/"
                }
            }
        },
        {
            "aggregated_data": {
                "properties_count": 3848
            },
            "havechilds": true,
            "id": 906,
            "label": "Africa",
            "translations": {
                "rus": {
                    "label": "Африка",
                    "propertylistings_url": "/for-sale/africa/listings/"
                }
            }
        }
    ]
}
en/public/developer/template_system/tags/api/get_geoplaces.txt · Last modified: 2014/03/03 18:50 by svanderclock