curl --request POST \
--url https://api.example.com/pois \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"address": "<string>",
"lat": 123,
"lng": 123,
"category": "<string>",
"open_time": {},
"close_time": {},
"average_stay_minutes": 123
}
'{
"message": "POI created succesfully"
}
Add a new point of interest to the catalog
curl --request POST \
--url https://api.example.com/pois \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"address": "<string>",
"lat": 123,
"lng": 123,
"category": "<string>",
"open_time": {},
"close_time": {},
"average_stay_minutes": 123
}
'{
"message": "POI created succesfully"
}
POST /pois
curl -X POST https://api.maytravel.com/pois \
-H "Content-Type: application/json" \
-d '{
"name": "Sagrada Familia",
"address": "Carrer de Mallorca, 401, 08013 Barcelona",
"lat": 41.4036,
"lng": 2.1744,
"category": "monument",
"open_time": "09:00:00",
"close_time": "20:00:00",
"average_stay_minutes": 90
}'
const response = await fetch('https://api.maytravel.com/pois', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Sagrada Familia',
address: 'Carrer de Mallorca, 401, 08013 Barcelona',
lat: 41.4036,
lng: 2.1744,
category: 'monument',
open_time: '09:00:00',
close_time: '20:00:00',
average_stay_minutes: 90
})
});
const result = await response.json();
import requests
data = {
'name': 'Sagrada Familia',
'address': 'Carrer de Mallorca, 401, 08013 Barcelona',
'lat': 41.4036,
'lng': 2.1744,
'category': 'monument',
'open_time': '09:00:00',
'close_time': '20:00:00',
'average_stay_minutes': 90
}
response = requests.post('https://api.maytravel.com/pois', json=data)
result = response.json()
{
"message": "POI created succesfully"
}
{
"error": "Missing required field: name"
}
backend/src/components/poi_catalog/controller/PoisController.mjs:14
The endpoint converts latitude and longitude coordinates into a PostGIS Point geometry using SRID 4326 (WGS 84) and stores it in the poi_catalog table.
ST_MakePoint and ST_SetSRID functions to ensure proper spatial data handling.