[% INCLUDE 'header.html', title => 'Open311' %]
[% loc('Open311 API for the mySociety FixMyStreet server') %]
[% IF error %]
[% tprintf( loc('Note: %s'), error ) %]
[% END %]
[% loc('At the moment only searching for and looking at reports work.') %]
[% loc('This API implementation is work in progress and not yet stabilized. It will change without warnings in the future.') %]
[% tprintf( loc('At most %d requests are returned in each query. The returned requests are ordered by requested_datetime, so to get all requests, do several searches with rolling start_date and end_date.'), c.config.RSS_LIMIT ) %]
[% loc('The following Open311 v2 attributes are returned for each request: service_request_id, description, lat, long, media_url, status, requested_datetime, updated_datetime, service_code and service_name.') %]
[% loc('In addition, the following attributes that are not part of the Open311 v2 specification are returned: agency_sent_datetime, title (also returned as part of description), interface_used, comment_count, requestor_name (only present if requestor allowed the name to be shown on this site).') %]
[% loc('The Open311 v2 attribute agency_responsible is used to list the administrations that received the problem report, which is not quite the way the attribute is defined in the Open311 v2 specification.') %]
[% tprintf( loc('With request searches, it is also possible to search for agency_responsible to limit the requests to those sent to a single administration. The search term is the administration ID provided by MaPit.'), c.config.MAPIT_URL ) %]
[% loc('Examples:') %]
[% jurisdiction_id = 'fiksgatami.no' %]
[% examples = [
{
url = c.cobrand.base_url _ "/open311/v2/discovery.xml?jurisdiction_id=$jurisdiction_id",
info = 'discovery information',
},
{
url = c.cobrand.base_url _ "/open311/v2/services.xml?jurisdiction_id=$jurisdiction_id",
info = 'list of services provided',
},
{
url = c.cobrand.base_url _ "/open311/v2/services.xml?jurisdiction_id=$jurisdiction_id&lat=60&long=11",
info = 'list of services provided for WGS84 coordinate latitude 60 longitude 11',
},
{
url = c.cobrand.base_url _ "/open311/v2/requests/1.xml?jurisdiction_id=$jurisdiction_id",
info = 'Request number 1',
},
{
url = c.cobrand.base_url _ "/open311/v2/requests.xml?jurisdiction_id=$jurisdiction_id&status=open&agency_responsible=1601&end_date=2011-03-10",
info = 'All open requests reported before 2011-03-10 to Trondheim (id 1601)',
},
{
url = c.cobrand.base_url _ "/open311/v2/requests.xml?jurisdiction_id=$jurisdiction_id&status=open&agency_responsible=219|220",
info = 'All open requests in Asker (id 220) and Bærum (id 219)',
},
{
url = c.cobrand.base_url _ "/open311/v2/requests.xml?jurisdiction_id=$jurisdiction_id&service_code=Vannforsyning",
info = "All requests with the category 'Vannforsyning'",
},
{
url = c.cobrand.base_url _ "/open311/v2/requests.xml?jurisdiction_id=$jurisdiction_id&status=closed",
info = 'All closed requests',
},
] %]
[% FOREACH examples %]
- [% info %]
[% IF url.match('/requests.xml') %]
[ [% loc('GeoRSS on Google Maps') %] ]
[% END %]
[% url | html %]
[% END %]
Searching
The following search parameters can be used:
- service_request_id
- Search for numeric ID of specific request.
Using this is identical to asking for a individual request using
the /requests/number.format URL.
- service_code
- Search for the given category / service type string.
- status
- Search for open or closed (fixed) requests.
- start_date
-
- Only return requests with requested_datetime set after or at the
date and time specified. The format is YYYY-MM-DDTHH:MM:SS+TZ:TZ.
- end_date
-
- Only return requests with requested_datetime set before the date
and time specified. Same format as start_date.
- agency_responsible
- ID of government body receiving the request. Several IDs can be
specified with | as a separator.
- interface_used
-
- Name / identifier of interface used.
- has_photo
-
- Search for entries with or without photos. Use value 'true' to
only get requests created with images, and 'false' to get those
created without images.
- max_requests
- Max number of requests to return from the search. If it is larger
than the site specific max_requests value specified in the discovery
call, the value provided is ignored.
The search result might look like this:
[% "
Statens vegvesen region øst
Oslo
2011-04-23T10:28:55+02:00
Mangler brustein: Det støver veldig på tørre dager. Her burde det vært brustein.
Det støver veldig på tørre dager. Her burde det vært brustein.
Web interface
59.916848
10.728148
2011-04-23T09:32:36+02:00
Petter Reinholdtsen
Annet
Annet
1
open
Mangler brustein
2011-04-23T10:28:55+02:00
" | html %]
[% INCLUDE 'footer.html' %]