Skip to Content

Utilities

Calendar, weather, and location services.

Overview

Utility services provide supporting functionality:

ServicePortPurpose
calendar_service8217Events, scheduling, sync
weather_service8218Weather data, forecasts
location_service8224Geolocation, geofencing

Calendar Service (8217)

Create Event

curl -X POST "http://localhost:8217/api/v1/calendar/events" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "title": "Team Meeting", "start_time": "2024-01-29T10:00:00Z", "end_time": "2024-01-29T11:00:00Z", "location": "Conference Room A", "recurrence": { "type": "weekly", "days": ["monday"] } }'

Sync with External Calendar

curl -X POST "http://localhost:8217/api/v1/calendar/sync" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "provider": "google", "access_token": "google_oauth_token", "sync_direction": "bidirectional" }'

Recurrence Types

TypeDescription
dailyEvery day
weeklyWeekly on specific days
monthlyMonthly on date or day
yearlyYearly on date

Weather Service (8218)

Get Current Weather

curl "http://localhost:8218/api/v1/weather/current?lat=37.7749&lon=-122.4194" \ -H "Authorization: Bearer YOUR_JWT_TOKEN"

Get Weather Forecast

curl "http://localhost:8218/api/v1/weather/forecast?lat=37.7749&lon=-122.4194&days=7" \ -H "Authorization: Bearer YOUR_JWT_TOKEN"

Weather Conditions

ConditionDescription
sunnyClear sky
partly_cloudyPartial clouds
cloudyOvercast
rainRain
snowSnow
thunderstormThunderstorm

Location Service (8224)

Report Location

curl -X POST "http://localhost:8224/api/v1/locations/report" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "latitude": 37.7749, "longitude": -122.4194, "accuracy": 10, "method": "gps" }'

Create Geofence

curl -X POST "http://localhost:8224/api/v1/geofences" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Home", "shape": "circle", "center": {"latitude": 37.7749, "longitude": -122.4194}, "radius": 100, "triggers": ["enter", "exit"] }'

Geofence Triggers

TriggerDescription
enterDevice enters geofence
exitDevice exits geofence
dwellDevice stays for specified time

Python SDK

from isa_user import CalendarClient, WeatherClient, LocationClient # Calendar calendar = CalendarClient("http://localhost:8217") event = await calendar.create_event( token=access_token, title="Team Meeting", start_time="2024-01-29T10:00:00Z", end_time="2024-01-29T11:00:00Z" ) # Weather weather = WeatherClient("http://localhost:8218") current = await weather.get_current( token=access_token, lat=37.7749, lon=-122.4194 ) # Location location = LocationClient("http://localhost:8224") geofence = await location.create_geofence( token=access_token, name="Home", center={"lat": 37.7749, "lon": -122.4194}, radius=100 )

Next Steps