Open311API Get Service Requests Readme

advertisement
document updated: March 30, 2012
Mobile Applications
311 Toronto - Open311 API Specifications
GetServiceRequests Method
Get Service Requests –
https://<path>/requests?{start_date}&{end_date}&jurisdiction_id=toronto.ca
For XML format
https://secure.toronto.ca/webwizard/ws/requests.xml?jurisdiction_id=toronto.ca
For JSON format
https://secure.toronto.ca/webwizard/ws/requests.json?jurisdiction_id=toronto.ca
Purpose: to query the status of multiple requests.
Examples
1) To retrieve a list of service request between Feb 1, 2012 to Feb 7, 2012 in XML format
https://secure.toronto.ca/webwizard/ws/requests.xml?start_date=2012-0201T00:00:00Z&end_date=2012-02-07T00:00:00Z&jurisdiction_id=toronto.ca
2) To retrieve a list of service request between Feb 1, 2012 to Feb 7, 2012 in JSON format
https://secure.toronto.ca/webwizard/ws/requests.json?start_date=2012-0201T00:00:00Z&end_date=2012-02-07T00:00:00Z&jurisdiction_id=toronto.ca
3) To retrieve a list of closed service requests in XML format.
https://secure.toronto.ca/webwizard/ws/requests.xml?status=closed&jurisdiction_id=toronto.ca
4) To retrieve a list of Pothole service requests in XML format.
https://secure.toronto.ca/webwizard/ws/requests.xml?service_code=CSROWR12&jurisdiction_id=toronto.ca
5) To retrieve a list of Graffiti service requests in XML format.
https://secure.toronto.ca/webwizard/ws/requests.xml?service_code=CSROWC-05,CSROWBM-03,
CSROSC-14,30102,SWLMALB-02&jurisdiction_id=toronto.ca
6) To retrieve a specific service request (based on service request id)
https://secure.toronto.ca/webwizard/ws/requests.xml?service_request_id=101001362391&jurisdiction
_id=toronto.ca
note can also be done using GetServiceRequest
https://secure.toronto.ca/webwizard/ws/requests/101001362391.xml?jurisdiction_id=toronto.ca
Notes
Get Service Requests method will return maximum of 1000 rows at a time.
Default query limit is a span of 90 Days or the first 1000 requests, whichever is smaller.
Required Arguments

jurisdiction_id - toronto.ca
Optional Arguments
service_request_id

- To call multiple Service Requests at once, multiple service_request_id can be declared; comma
delimited. This overrides all other arguments.
service_code

- Specify the service type by calling the unique ID of the service_code. This defaults to all service
codes when not declared; can be declared multiple times, comma delimited
start_date

- Earliest datetime to include in search. When provided with end_date, allows one to search for
requests which have a requested_datetime that matches a given range, but may not span more than 90
days. When not specified, the range defaults to most recent 90 days. Must use w3 format, eg 2010-0101T00:00:00Z.
end_date

- Latest datetime to include in search. When provided with start_date, allows one to search for
requests which have a requested_datetime that matches a given range, but may not span more than 90
days. When not specified, the range defaults to most recent 90 days. Must use w3 format, eg 2010-0101T00:00:00Z.
status

Options: open, closed

- Allows one to search for requests which have a specific status. This defaults to all statuses; can
be declared multiple times, comma delimited;
Exceptions:
- status of open or closed returned – a Lookup Table is used to map the many 311 Toronto status values
to either open or closed.
- agency_responsible always set to 311 Toronto
- service_notice: not returned
- zipcode: not returned
Response
service_requests

- root element
request

- container for variable, code, datatype, required, datatype_description, order, description, values
service_request_id

- The unique ID for the service request returned
status

Options: open, closed

- The current status of the service request. Open means that it has been reported. Closed means
that it has been resolved or cancelled.
status_notes

- Explanation of why status was changed to current state or more details on current status than
conveyed with status alone.
service_name

- The human readable name of the service request type
service_code

- The unique identifier for the service request type
description

- A full description of the request or report submitted. This may contain line breaks, but not html or
code. Otherwise, this is free form text limited to 4,000 characters.
agency_responsible

- The agency responsible for fulfilling or otherwise addressing the service request
service_notice

- Information about the action expected to fulfill the request or otherwise address the information
reported. (May not be returned)
requested_datetime

- The date and time when the service request was made. Returned in w3 format, eg 2010-0101T00:00:00Z
updated_datetime

- The date and time when the service request was last modified. For requests with status=closed,
this will be the date the request was closed. Returned in w3 format, eg 2010-01-01T00:00:00Z
expected_datetime

- The date and time when the service request can be expected to be fulfilled. This may be based on
a service-specific service level agreement. (May not be returned)
address

- Human readable address or description of location. This should be provided from most specific to
most general geographic unit, eg address number or cross streets, street name, neighborhood/district,
city/town/village, county, postal code.
address_id

- The internal address ID used by a jurisdictions master address repository or other addressing
system.
zipcode

- The postal code for the location of the service request.
lat

- latitude using the (WGS84) projection.
long

- longitude using the (WGS84) projection.
media_url

- A URL to media associated with the request, eg an image.
Download