SDK reference

Weather

Each route's function in the SDK, its call beside the same request in cURL.
weatherForecast

GET/v1/weather/forecast

The forecast at a point: current conditions, today, hours hourly (1–48, default 24, from the current hour) and days daily (1–16, default 10, from today in the place's time zone), air quality where there is some, and the attribution to show with it. Cached for 10 minutes per 1 km cell. units (metric or imperial) defaults to the person's saved choice. place names the caller's saved place within 1.5 km. 429 (with Retry-After) past the per-person limits.

Parameters and answers
curl 'https://api.cactive.com.au/v1/weather/forecast?lat=1&lon=1' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
weatherRadar

GET/v1/weather/radar

The rain radar's recent frames (the past two hours, every 10 minutes, oldest first) as tile addresses for a map's raster layer, to maxZoom, with the credit to show. enabled is false and there are no frames while the radar is off. Counts as one request.

Parameters and answers
curl 'https://api.cactive.com.au/v1/weather/radar' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
meWeatherPlaces

GET/v1/me/weather/places

Your saved places in your order, and your units (metric until you choose). The same on every device.

Parameters and answers
curl 'https://api.cactive.com.au/v1/me/weather/places' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
putMeWeatherPlaces

PUT/v1/me/weather/places

Replaces your saved places with places, in order (up to the weather.places limit, 20 by default), and sets units when given. A place without a placeId gets one (wpl_…). Coordinates are kept to 3 decimals. Not from an assistant.

Parameters and answers
curl -X PUT 'https://api.cactive.com.au/v1/me/weather/places' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "places": [
      {
        "name": "Example",
        "lat": 1,
        "lon": 1,
        "timeZone": "example"
      }
    ]
  }'
meWeatherAlerts

GET/v1/me/weather/alerts

Your rain and severe weather alerts: the kinds, the places (saved place ids and here) and their limits.

Parameters and answers
curl 'https://api.cactive.com.au/v1/me/weather/alerts' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"
putMeWeatherAlerts

PUT/v1/me/weather/alerts

Turns rain and severe weather alerts on or off and chooses their places (saved ones and here, My Location, up to weather.alerts.places). Push only. Dropping here forgets My Location. Not from an assistant.

Parameters and answers
curl -X PUT 'https://api.cactive.com.au/v1/me/weather/alerts' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "rain": true,
    "warnings": true,
    "places": [
      "example"
    ]
  }'
putMeWeatherAlertsHere

PUT/v1/me/weather/alerts/here

Where this phone or browser is, while My Location is one of your alert places: kept as its 1 km cell for weather.alerts.hereHours, never logged. 403 unless My Location alerts are on. Not from an assistant.

Parameters and answers
curl -X PUT 'https://api.cactive.com.au/v1/me/weather/alerts/here' \
  -H "Authorization: Bearer $CACTIVE_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
    "lat": 1,
    "lon": 1
  }'
deleteMeWeatherAlertsHere

DELETE/v1/me/weather/alerts/here

Forgets My Location's last cell.

Parameters and answers
curl -X DELETE 'https://api.cactive.com.au/v1/me/weather/alerts/here' \
  -H "Authorization: Bearer $CACTIVE_TOKEN"