User Tools

Site Tools


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

This is an old revision of the document!


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.languages[<#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_parent=2147474760
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_parent="2147474760"
                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": [
    {
      "id": "2147474764",
      "aggregated_data": {
        "properties_count": "156"
      },
      "havechilds": "1",
      "label": "South America",
      "translations": {
        "enu": {
          "label": "South America",
          "propertylistings_url": "/for-sale/south-america/listings/"
        }
      }
    },
    {
      "id": "2147474768",
      "aggregated_data": {
        "properties_count": "53"
      },
      "havechilds": "1",
      "label": "Oceania",
      "translations": {
        "enu": {
          "label": "Oceania",
          "propertylistings_url": "/for-sale/oceania/listings/"
        }
      }
    },
    {
      "id": "2147474769",
      "aggregated_data": {
        "properties_count": "5554"
      },
      "havechilds": "1",
      "label": "North and Central America",
      "translations": {
        "enu": {
          "label": "North and Central America",
          "propertylistings_url": "/for-sale/north-and-central-america/listings/"
        }
      }
    },
    {
      "id": "2147474774",
      "aggregated_data": {
        "properties_count": "84617"
      },
      "havechilds": "1",
      "label": "Asia",
      "translations": {
        "enu": {
          "label": "Asia",
          "propertylistings_url": "/for-sale/asia/listings/"
        }
      }
    },
    {
      "id": "2147474778",
      "aggregated_data": {
        "properties_count": "1830119"
      },
      "havechilds": "1",
      "label": "Europe",
      "translations": {
        "enu": {
          "label": "Europe",
          "propertylistings_url": "/for-sale/europe/listings/"
        }
      }
    },
    {
      "id": "2147474782",
      "aggregated_data": {
        "properties_count": "1433"
      },
      "havechilds": "1",
      "label": "Africa",
      "translations": {
        "enu": {
          "label": "Africa",
          "propertylistings_url": "/for-sale/africa/listings/"
        }
      }
    }
  ]
}
en/public/developer/template_system/tags/api/get_geoplaces.1392981913.txt.gz · Last modified: 2014/02/21 15:25 by admin