List of Areas
Each city or district constitutes an Area in Recollect.
You can fetch the list of available areas with the /api/areas API call.
- /api/areas -
text/html - /api/areas.txt -
text/plain - /api/areas.json -
application/json
Area Data
You can fetch data for each area using the
/api/areas/:area_name API call.
:area_name can be either the area id or the text name of
the Area.
This data is also available as text/plain,
application/json
and KML (application/xml).
List of Zones
Each Area will have one or more geographic pickup zones. Each Zone
will have it's own set of pickup times.
You can fetch the list of zones for an area with the /api/areas/:area_name/zones
API call.
- /api/areas/Vancouver/zones -
text/html - /api/areas/Vancouver/zones.txt -
text/plain - /api/areas/Vancouver/zones.json -
application/json
Zone Data
Each zone has its own resource page.
You can fetch the details for a zone with the
/api/areas/:area_name/zones/:zone_name API.
This data is also available as text/plain ,
application/json and
KML - application/xml.
Each zone has several pieces of data available:
- Pickup Days - The list of pickup days for the zone
- Next Pickup - The next pickup day for this zone
- Next Day of Week Change - The next pickup day that occurs on a different day of the week than its previous pickup
This data is also has text and JSON representations:
- Pickup Days:
text/plain,application/json,text/calendar (iCal) - Next Pickup:
text/plain,application/json - Next DOW Change:
text/plain,application/json
Dates are expressed as YYYY-MM-DD[ F]. Each pickup has a set of flags associated with it. The flags indicate what kind of pickup will happen. The flags are represented as a string of characters, each character is one of the flags specified here:
G- Garbage will be picked up.R- Recycling will be picked up.Y- Yard compost will be picked up.
The nextpickup request accepts a limit GET parameter to show the next several pickups.
(eg: /api/areas/Vancouver/zones/vancouver-north-blue/nextpickup.txt?limit=5).
Zone Lookups
You can look up a zone either by lat,long or by zone name. These APIs will return a 302 redirect if a zone was found, or a 404 otherwise.
/api/lookup/:lat,:long/api/lookup/:zone-name
These APIs can also be appended with a file extension (.json, say) which will be appended to the redirect URL.
API Version
The API has a simple version number resource at /api/version.
This API version will only be updated when incompatible changes need to happen. All other incremental changes will happen without changing this number.
Webhooks
If you would like to receive garbage day notifications via a HTTP POST, webhooks are a available as a supported notification mechanism. If you create a subscription with a target of "webhook:http://example.com", Recollect will send a HTTP POST to this URL with a JSON payload containing details about the notification. If you want to use this please tweet @lukec for help.
