# Areas

❗️ Note

The API calls in this section also support the variables quantity (boolean), id_property_type (see Property Types), for_sale (boolean), for_rent (boolean), for_transfer (boolean) and scope (number), for an example of this, see the Countries section.

To obtain information about all the areas of a specific city knowing its id we have the general URI:

api.wasi.co/v1/location/zones-from-city/#id_city

For example for Armenia the id_city is 63, so the URI would be:

api.wasi.co/v1/location/zones-from-city/794

This should return a JSON with the zones entered as this:

{
    "0": {
        "id_zone": "1",
        "name": "North",
        "id_city": "63",
        "id_location": 0,
        "owner": "own"
    },
    "1": {
        "id_zone": "2",
        "name": "South",
        "id_city": "63",
        "id_location": 0,
        "owner": "own"
    },
    "2": {
        "id_zone": "3",
        "name": "Center",
        "id_city": "63",
        "owner": "own"
    },
    "3": {
        "id_zone": "3",
        "name": "Center",
        "id_city": "63",
        "id_location": 0,
        "owner": "allied"
    },
    "status": "success"
}

❗ ️ Important

With this call only the areas that are not associated with a Location will be released.

In the case of the zones that are associated to a Location, you can obtain all the specific zones knowing their id, we have the general URI:

api.wasi.co/v1/location/zones-from-location/#id_location

For example for Chapinero the id_location is 2, so the URI would be:

api.wasi.co/v1/location/zones-from-location/2

This should return a JSON with the zones entered as this:

{
    "0": {
        "id_zone": "137805",
        "name": "Refugio",
        "id_city": 794,
        "id_location": 2,
        "owner": "standard"
    },
    "1": {
        "id_zone": "137806",
        "name": "San Isidro",
        "id_city": 794,
        "id_location": 2,
        "owner": "own"
    },
    "status": "success"
}

The owner field in the JSON response indicates whether the property obtained is owned (own), by an allied company (allied) or by Wasi (standard).

Additionally for the Zones the variable scope is used to filter the private or allied zones in the zone list. By default, if this variable is not sent all zones are listed. The owner field in the response JSON indicates whether the zone obtained is your own (own) or an ally's (allied).

Value Represents
1 Private, only areas created by the company (default).
2 Allies, only zones assigned to the active properties of allied companies
3 Private and Allied, all areas.

As the zones are editable by the user, it can happen that there are several zones with the same name, in that case you can send the parameter distinct with value true so that the zones are grouped by name, the identifiers are separated by comma in the field id_zone.

For example if for city 1 there are several zones with the name Center Zone, then the URI would be:

api.wasi.co/v1/location/zones-from-city/1?distinct=true

This should return a JSON with areas like this:

{
    "0": {
        "id_zone": "1.4",
        "name": "Downtown",
        "id_city": 1,
        "id_location": 0,
        "owner": ""
    },
    "1": {
        "id_zone": "2",
        "name": "Northern Zone",
        "id_city": 1,
        "id_location": 0,
        "owner": "standard"
    },
}

❗ ️ Important

Zones are managed from Wasi.co, if no zones have been entered the JSON will only have the status success.

To obtain information about a specific zone knowing its ID, you have the general URI:

api.wasi.co/v1/location/zone/#id_zone

For an example zone called North the id_zone is 1, so the URI would be:

api.wasi.co/v1/location/zone/1

And you get the answer:

{
    "id_zone": "1",
    "name": "North",
    "id_city": "63",
    "id_location": "0",
    "status": "success"
}

❗ ️ Important

For all requests it is necessary to send credentials, for more information you can visit the section of Getting Started.

❗ ️ Note

It is possible to create a new zone by sending the zone field as text when adding or updating a property as indicated in Property fields.

Last Updated: 8/3/2020, 9:51:52 PM