(added attributes container on GET Service Definition to documentation and xml example) |
(Shortening example for Get Service List) |
||
| Line 140: | Line 140: | ||
<service_name>Curb or curb ramp defect</service_name> | <service_name>Curb or curb ramp defect</service_name> | ||
<description>Sidewalk curb or ramp has problems such as cracking, missing pieces, holes, and/or chipped curb.</description> | <description>Sidewalk curb or ramp has problems such as cracking, missing pieces, holes, and/or chipped curb.</description> | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
</service> | </service> | ||
</services> | </services> | ||
| − | |||
</pre> | </pre> | ||
This page is for making proposals regarding the main GeoReport v2 spec since that page is locked for editing
The GeoReport API allows developers to build applications to report non-emergency issues such as graffiti, potholes, and street cleaning directly to government organizations like cities.
Beta: The GeoReport v2 Spec is being beta testing and is not yet stable for production.
Servers receive and manage reports on behalf of a jurisdiction.
Note that the URLs require a method and jurisdiction_id at the end, the root URL is not intended to be accessed directly.
| Name | Status | API Key | Dev API | Production API |
|---|---|---|---|---|
| San Francisco | Development Ready | Request Key | Dev URL | Production URL |
| Washington D.C. | Development Ready | - | - | Production URL |
All date/time fields must be formatted in a common subset of ISO 8601 as per the w3 note. Timezone information (either Z meaning UTC, or an HH:MM offset from UTC) must be included.
Examples:
UTF-8 is required everywhere.
All text returned by the service, whether in XML, JSON, or any other text-based content-type, MUST be encoded as UTF-8. Appropriate HTTP headers must be set, and the root element must be preceded with the XML declaration including the encoding="UTF-8" attribute. All text received by the service from the client will be assumed to be UTF-8 and must be decoded accordingly.
As a means to allow this API to distinguish multiple jurisdictions we've included a "jurisdiction_id" which will be the unique identifier for cities. It has been suggested that we use the jurisdiction's main website root url (without the www) as the "jurisdiction_id". For San Francisco, the jurisdiction_id is sfgov.org. Implementations can ignore this parameter and treat it as an "Optional Argument" if the implementation only serves one jurisdiction.
"Optional" means that the response should be the same whether a parameter is passed and is empty or is not passed at all. A null parameter should be treated as equivalent to a non-declared parameter in processing the request.
The numbers represent the HTTP status code returned for each error type:
<?xml version="1.0" encoding="utf-8"?> <services> <service> <service_code>001</service_code> <service_name>Cans left out 24x7</service_name> <description>Garbage or recycling cans that have been left out for more than 24 hours after collection. Violators will be cited.</description> <metadata>true</metadata> <type>realtime</type> <keywords>lorem, ipsum, dolor</keywords> <group>sanitation</group> </service> <service> <service_code>002</service_code> <metadata>true</metadata> <type>realtime</type> <keywords>lorem, ipsum, dolor</keywords> <group>street</group> <service_name>Construction plate shifted</service_name> <description>Metal construction plate covering the street or sidewalk has been moved.</description> </service> <service> <service_code>003</service_code> <metadata>true</metadata> <type>realtime</type> <keywords>lorem, ipsum, dolor</keywords> <group>street</group> <service_name>Curb or curb ramp defect</service_name> <description>Sidewalk curb or ramp has problems such as cracking, missing pieces, holes, and/or chipped curb.</description> </service> </services>
The numbers represent the HTTP status code returned for each error type:
<?xml version="1.0" encoding="utf-8"?> <service_definition> <service_code>DMV66</service_code> <attributes> <attribute> <variable>true</variable> <code>WHISHETN</code> <datatype>singlevaluelist</datatype> <required>true</required> <datatype_description></datatype_description> <order>1</order> <description>What is the ticket/tag/DL number?</description> <values> <value> <key>123</key> <name>Ford</name> </value> <value> <key>124</key> <name>Chrysler</name> </value> </values> </attribute> </attributes> </service_definition>
The numbers represent the HTTP status code returned for each error type:
POST /dev/v2/requests.xml Host: open311.sfgov.org Content-Type: application/x-www-form-urlencoded; charset=utf-8 api_key=xyz&jurisdiction_id=sfgov.org&service_code=001&lat=37.76524078&long=-122.4212043&address_string=1234+5th+street&email=smit333%40sfgov.edu&device_id=tt222111&account_id=123456&first_name=john&last_name=smith&phone=111111111&description=A+large+sinkhole+is+destroying+the+street&media_url=http%3A%2F%2Ffarm3.static.flickr.com%2F2002%2F2212426634_5ed477a060.jpg&attribute[WHISPAWN]=123456&attribute[WHISDORN]=COISL001
Example response:
<?xml version="1.0" encoding="utf-8"?> <service_requests> <request> <service_request_id>293944</service_request_id> <service_notice> The City will inspect and require the responsible party to correct within 24 hours and/or issue a Correction Notice or Notice of Violation of the Public Works Code </service_notice> <account_id/> </request> </service_requests>
The numbers represent the HTTP status code returned for each error type:
<?xml version="1.0" encoding="utf-8"?> <service_requests> <request> <service_request_id>638344</service_request_id> <token>12345</token> </request> </service_requests>
The numbers represent the HTTP status code returned for each error type:
<?xml version="1.0" encoding="utf-8"?> <service_requests> <request> <service_request_id>638344</service_request_id> <status>closed</status> <status_notes>Duplicate request.</status_notes> <service_name>Sidewalk and Curb Issues</service_name> <service_code>006</service_code> <description></description> <agency_responsible></agency_responsible> <service_notice></service_notice> <requested_datetime>2010-04-14T06:37:38-08:00</requested_datetime> <updated_datetime>2010-04-14T06:37:38-08:00</updated_datetime> <expected_datetime>2010-04-15T06:37:38-08:00</expected_datetime> <address>8TH AVE and JUDAH ST</address> <address_id>545483</address_id> <zipcode>94122</zipcode> <lat>37.762221815</lat> <long>-122.4651145</long> <media_url>http://open311.city.gov.s3.amazonaws.com/requests/media/638344.rss </media_url> </request> <request> <service_request_id>638349</service_request_id> <status>open</status> <status_notes></status_notes> <service_name>Sidewalk and Curb Issues</service_name> <service_code>006</service_code> <description></description> <agency_responsible></agency_responsible> <service_notice></service_notice> <requested_datetime>2010-04-19T06:37:38-08:00</requested_datetime> <updated_datetime>2010-04-19T06:37:38-08:00</updated_datetime> <expected_datetime>2010-04-19T06:37:38-08:00</expected_datetime> <address>8TH AVE and JUDAH ST</address> <address_id>545483</address_id> <zipcode>94122</zipcode> <lat>37.762221815</lat> <long>-122.4651145</long> <media_url>http://open311.city.gov.s3.amazonaws.com/requests/media/638349.rss </media_url> </request> </service_requests>
The numbers represent the HTTP status code returned for each error type:
<?xml version="1.0" encoding="utf-8"?> <service_requests> <request> <service_request_id>638344</service_request_id> <status>closed</status> <status_notes>Duplicate request.</status_notes> <service_name>Sidewalk and Curb Issues</service_name> <service_code>006</service_code> <description></description> <agency_responsible></agency_responsible> <service_notice></service_notice> <requested_datetime>2010-04-14T06:37:38-08:00</requested_datetime> <updated_datetime>2010-04-14T06:37:38-08:00</updated_datetime> <expected_datetime>2010-04-15T06:37:38-08:00</expected_datetime> <address>8TH AVE and JUDAH ST</address> <address_id>545483</address_id> <zipcode>94122</zipcode> <lat>37.762221815</lat> <long>-122.4651145</long> <media_url>http://open311.city.gov.s3.amazonaws.com/requests/media/638344.rss </media_url> </request> </service_requests>
Response:
Example:
HTTP/1.1 403 Forbidden <?xml version="1.0" encoding="utf-8"?> <error>Invalid api_key received -- can't proceed with create_request.</error>