Every published listing is stored in our database under its Id. You can eventually unpublish it (Zonaprop API > DELETE aviso ), republish it (Zonaprop API > PUT aviso ) or modify it without losing the data.
Mapping a zone means finding an equivalence between a zone in your APP and a zone in Navent.
Every mapping made by your APP is stored in our database under its Id. You can eventually delete or modify it.
- A database where you can store your mapping data
- Methods to perform mappings between the zones of your APP and the Navent Zones
- Methods to retrieve the mapped zone and fill in your property JSON (Zonaprop API > Property Object )
Methods / Endpoints
Zone mapping consists of a set of web services that work together with a database to provide the functionality.
Headers
For all methods included in this documentation
| Type | Description |
|---|---|
| Authorization | Property API authorization token |
Map Zone (PUT)
This endpoint is used to map Zonaprop zones with those of an external app.
A mapping inserts a record into our database, which can be retrieved later with a GET method
Production
| Resource information | |
|---|---|
| Authentication | Required |
| HTTP Method | PUT |
| Response | JSON |
| Version | 1 |
Resource URL
https://api-navent.mapaprop.com/property-api/navent/put-zone
Parameters - URL
| Name | Type | Required | Description |
|---|---|---|---|
brandZoneId | string | yes | The zone id from the app |
brand | string | yes | The app name |
brandZoneName | string | yes | The zone name from the app |
naventNewZoneId | string | yes | The Zonaprop zone id |
naventNewZoneName | string | yes | The Zonaprop zone name |
Response
A string indicating that the mapping was successful
| Object | Field | Type | Description |
|---|---|---|---|
| Response | success | string | 'Navent Zone mapping ok' |
| error | string | A text indicating where the error occurred |
Sample code
//Authorization required
//METHOD PUT
//Endpoint
https://api-navent.mapaprop.com/property-api/navent/put-zone?brandZone=appZone&brand=app&naventNewZone=naventZoneId&naventNewZoneName=description&brandZoneName=appZoneName
//Parameters
//* brandZone
//* brand
//* brandZoneName
//* naventNewZone
//* naventNewZoneName
As shown in this example, the values are 1-2-203-1032 (app zone id), mapaprop (app), V1-C-1004013 (api zone id), Lanús (api zone name) and Argentina, Buenos Aires, Lanús, Lanús Oeste (app zone name).
?brandZone=1-2-203-1032&brand=mapaprop&naventNewZone=V1-C-1004013&naventNewZoneName=Lanús&brandZoneName=Argentina, Buenos Aires, Lanús, Lanús Oeste
We get the following response in case of success.
Navent Zone mapping ok
Get mapped zone (GET)
This web service is used to retrieve the mapped zone, based on your APP's zone, from our system database.
Production
| Resource information | |
|---|---|
| Authentication | Required |
| HTTP Method | GET |
| Response | JSON |
| Version | 1 |
Resource URL
https://api-navent.mapaprop.com/property-api/navent/get-zone
Parameters - URL
| Key | Type | Required | Description |
|---|---|---|---|
brandZoneId | string | yes | The zone id from the app |
brand | string | yes | The app name |
Response
The complete JSON of the mapped zone
| Object | Field | Type | Description |
|---|---|---|---|
| Response | success | JSON | The JSON of the mapped zone |
| error | string | A text indicating where the error occurred |
Sample code
//Authorization required
//METHOD GET
//Endpoint
https://api-navent.mapaprop.com/property-api/navent/get-zone?brandZoneId=1-1-19-0&brand=mapaprop
//Parameters
//* brandZoneId
//* brand
As shown in this example, the values are mapaprop (brand) and 1-1-19-0 (app zone id).
?brandZoneId=1-1-19-0&brand=mapaprop
In case of success, we will get the following JSON response.
{
"nz_brand": "mapaprop",
"nz_brand_zone_id": "1-1-19-0",
"nz_navent_zone_name": "Cid Campeador",
"nz_navent_zone_id": "V1-D-1199748"
}
Get zone states from country (GET)
This web service is used to retrieve the states of a country based on an ISO code
Production
| Resource information | |
|---|---|
| Authentication | Required |
| HTTP Method | GET |
| Response | JSON |
| Version | 1 |
Resource URL
https://api-navent.mapaprop.com/property-api/navent/get-api-cities-state
Parameters - URL
| Key | Type | Required | Description |
|---|---|---|---|
countryIso | string | yes | The country ISO code. Based on this nomenclature |
Response
The complete JSON of the mapped zone
| Object | Field | Type | Description |
|---|---|---|---|
| Response | success | JSON | The JSON of the country state |
| error | string | A text indicating where the error occurred |
Sample code
//Authorization required
//METHOD GET
//Endpoint
https://api-navent.mapaprop.com/property-api/navent/get-api-states?apiKey=xxx&countryIso=AR
//Parameters
//* apiKey
//* countryIso
As shown in this example, the values are xxx (apiKey) and AR (country ISO).
?apiKey=xxx&countryIso=AR
In case of success, we will get the following JSON response.
[
{
"id": "V1-B-1",
"nombre": "Buenos Aires (fuera de GBA)",
"nombreCompleto": "Buenos Aires (fuera de GBA),Argentina"
},
{
"id": "V1-B-2000",
"nombre": "Buenos Aires Costa Atlántica",
"nombreCompleto": "Buenos Aires Costa Atlántica,Argentina"
},
{
"id": "V1-B-6",
"nombre": "Capital Federal",
"nombreCompleto": "Capital Federal,Argentina"
},
....
Get zone cities from state (GET)
This web service is used to retrieve the city zone from a state based on its id (obtained in the previous method)
Production
| Resource information | |
|---|---|
| Authentication | Required |
| HTTP Method | GET |
| Response | JSON |
| Version | 1 |
Resource URL
https://api-navent.mapaprop.com/property-api/navent/get-api-cities-state?apiKey=xxxx&stateId=V1-B-6
Parameters - URL
| Key | Type | Required | Description |
|---|---|---|---|
countryIso | string | yes | The country ISO code |
apiKey | string | yes | The Zonaprop API token |
Response
The complete JSON of the mapped zone
| Object | Field | Type | Description |
|---|---|---|---|
| Response | success | JSON | The JSON of the state's cities. |
| error | string | A text indicating where the error occurred |
Sample code
//Authorization required
//METHOD GET
//Endpoint
https://api-navent.mapaprop.com/property-api/navent/get-api-cities-state?apiKey=xxxx&stateId=V1-B-6
//Parameters
//* apiKey
//* stateId
As shown in this example, the values are xxx (apiKey) and V1-B-6 (state id).
?apiKey=xxx&stateId=V1-B-6
In case of success, we will get the following JSON response.
[
{
"id": "V1-B-1",
"nombre": "Buenos Aires (fuera de GBA)",
"nombreCompleto": "Buenos Aires (fuera de GBA),Argentina"
},
{
"id": "V1-B-2000",
"nombre": "Buenos Aires Costa Atlántica",
"nombreCompleto": "Buenos Aires Costa Atlántica,Argentina"
},
{
"id": "V1-B-6",
"nombre": "Capital Federal",
"nombreCompleto": "Capital Federal,Argentina"
},
....
Get zone neighborhoods from city (GET)
This web service is used to retrieve the neighborhood zones of a city based on its id (obtained in the previous method)
Production
| Resource information | |
|---|---|
| Authentication | Required |
| HTTP Method | GET |
| Response | JSON |
| Version | 1 |
Resource URL
https://api-navent.mapaprop.com/property-api/navent/get-api-neighborhoods-city?apiKey=xxxx&cityId=V1-C-1003667
Parameters - URL
| Key | Type | Required | Description |
|---|---|---|---|
cityId | string | yes | The city ISO code |
apiKey | string | yes | The Zonaprop API token |
Response
The complete JSON of the mapped zone
| Object | Field | Type | Description |
|---|---|---|---|
| Response | success | JSON | The JSON of the state's cities. |
| error | string | A text indicating where the error occurred |
Sample code
//Authorization required
//METHOD GET
//Endpoint
https://api-navent.mapaprop.com/property-api/navent/get-api-neighborhoods-city?apiKey=xxxx&cityId=V1-C-1003667
//Parameters
//* apiKey
//* cityId
As shown in this example, the values are xxx (apiKey) and V1-C-1003667 (city id).
?apiKey=xxx&cityId=V1-C-1003667
In case of success, we will get the following JSON response.
{
"id": "V1-C-1003667",
"nombre": "Almagro",
"nombreCompleto": "Almagro,Capital Federal,Argentina",
"localidades": [
{
"id": "V1-D-1199773",
"nombre": "Almagro Norte",
"nombreCompleto": "Almagro Norte,Almagro,Capital Federal,Argentina"
},
{
"id": "V1-D-1199774",
"nombre": "Almagro Sur",
"nombreCompleto": "Almagro Sur,Almagro,Capital Federal,Argentina"
}
]
}
Get zone sub-neighborhoods from neighborhood (GET)
This web service is used to retrieve the sub-neighborhood zones from a neighborhood based on its id (obtained in the previous method)
Production
| Resource information | |
|---|---|
| Authentication | Required |
| HTTP Method | GET |
| Response | JSON |
| Version | 1 |
Resource URL
https://api-navent.mapaprop.com/property-api/navent/get-api-sub-neighborhood?apiKey=xxxx&neighborhoodId=V1-D-1012994
Parameters - URL
| Key | Type | Required | Description |
|---|---|---|---|
neighborhoodId | string | yes | The neighborhood id |
apiKey | string | yes | The Zonaprop API token |
Response
The complete JSON of the mapped zone
| Object | Field | Type | Description |
|---|---|---|---|
| Response | success | JSON | The JSON of the state's cities. |
| error | string | A text indicating where the error occurred |
Sample code
//Authorization required
//METHOD GET
//Endpoint
https://api-navent.mapaprop.com/property-api/navent/get-api-sub-neighborhood?apiKey=xxxx&neighborhoodId=V1-D-1012994
//Parameters
//* apiKey
//* neighborhoodId
As shown in this example, the values are xxx (apiKey) and V1-D-1012994 (neighborhood id).
?apiKey=xxx&neighborhoodId=V1-D-1012994
In case of success, we will get the following JSON response.
{
"id": "V1-D-1012994",
"nombre": "El Pato",
"nombreCompleto": "El Pato,Berazategui,GBA Sur,Argentina",
"localidades": [....]
}
Usage example: New mapping
This is an example of a use case for creating a new mapping.
GET to retrieve the mapping
First, once we have made a GET request to the following endpoint for an unmapped zone:
https://api-navent.mapaprop.com/property-api/navent/get-zone?brandZoneId=1-1-19-0&brand=APP
When no mapping is found, we get an error. The error response we must interpret to start the mapping is
statusCode: 500, (Int)
body: 'Zone not found. Brand or Zone error.', (String)
Search for the compatible Navent zone
From this point we should create a mapping using the Map Zone (PUT) method. To do this we first need to find our Zone within the Navent API. To that end, we will navigate through the endpoints to reach our final zone, where we will obtain a Zone code, and finally create a mapping with Map Zone (PUT)
Then we make a GET request to the following endpoint passing a country id as parameter (AR, BR or LAT)
AR: Exclusively for Argentina
BR: Exclusively for Brazil
LAT For the rest of Latin America
1. Get Navent states
We pass the parameters countryIso and apiKey, resulting in something like this:
https://api-navent.mapaprop.com/property-api/navent/get-api-states?countryIso=AR&apiKey=40a6660d-dfb3-48ca-8cbd-f381a525b2a4
We receive in response all the available states or provinces for that country in Zonaprop
Once we get this, we create a function to interpret this response.
https://api-navent.mapaprop.com/property-api/navent/get-api-states
Example function in JS
// Navent MAPPING
let apiKey = xxxx;
let getNaventStates = (countryIsoCode) => {
$http.get(
'https://api-navent.mapaprop.com/property-api/navent/get-api-states?apiKey='+ apiKey +'&countryIso=' + countryIsoCode)
.then((response) => {
console.log("Response state data" , response)
naventStates = response.data;
});
};
We store the response.data in a variable and move on to the next endpoint
2. Get Navent Cities
https://api-navent.mapaprop.com/property-api/navent/get-api-cities-state
Here we pass the selected state as a parameter to a new function:
let naventGetCities = (state) => {
$scope.loadingModal = true;
let naventState = JSON.parse(state.id);
$http.get(
'https://api-navent.mapaprop.com/property-api/navent/get-api-cities-state?apiKey='+ apiKey +'&stateId=' + naventState.id, configNavent).then((response) => {
console.log("Response cities data" , response)
naventCities = response.data.localidades;
});
};
Then we move on to the next endpoint to get the neighborhoods of the previous city
3. Get Navent Neighborhoods
https://api-navent.mapaprop.com/property-api/navent/get-api-neighborhoods-city
We create a function to store them. In this case we should add an if statement before storing the neighborhoods, as the city may not contain any.
let naventGetNeighborhoods = (city) => {
let naventCity = JSON.parse(city);
console.log(naventCity)
$scope.naventCity = naventCity;
$http.get(
'https://api-navent.mapaprop.com/property-api/navent/get-api-neighborhoods-city?apiKey='+ apiKey +'&cityId=' + naventCity.id, configNavent).then((response) => {
**if(response.data.localidades != []){
c**onsole.log("Response neighborhoods data" , response)
**naventNeighborhoods = response.data.localidades;
}**
});
};
Finally we create the last function to get sub-neighborhoods from the next endpoint
4. Get Navent Sub Neighborhoods
https://api-navent.mapaprop.com/property-api/navent/get-api-sub-neighborhood
let naventGetSubNeighborhoods = (neighborhood) => {
if (neighborhood) {
$http.get(
'https://api-navent.mapaprop.com/property-api/navent/get-api-sub-neighborhood?apiKey='+ apiKey +'&neighborhoodId=' + naventNeighborhood.id, configNavent).then((response) => {
console.log("Response SubNeighborhoods data" , response)
naventSubNeighborhoods = response.data.localidades;
});
}
};
Once we have obtained all the data for the mapping, we make the final PUT
Finalize the mapping with the PUT method
https://api-navent.mapaprop.com/property-api/navent/put-zone
//Here we pass the parameters to the PUT
//* brandZoneId Is the zone id of the application
//* brand The app name (unique and constant per application)
//* naventNewZone Is the Zonaprop zone id
//* naventNewZoneName Is the Zonaprop zone name
//* brandZoneName Is the zone name of the application
//Endpoint
https://api-navent.mapaprop.com/property-api/navent/put-zone?brandZoneId='+ appZone +'&brand=appName&naventNewZone='+ naventNewZone + '&naventNewZoneName=' + naventNewZoneName + '&brandZoneName=' + brandZoneName