-
-
Notifications
You must be signed in to change notification settings - Fork 269
Open311 FMS Proposed differences to Open311
Open311 does a lot of the things that FixMyStreet requires but it's lacking in a few places. This is a proposal to fill those holes.
This page should be read in conjunction with the Open311 specification.
The changes to Open311 in this document and wiki are as follows:
- All requests should be over HTTPS
- Add a GET Service Request Updates
- Add a POST Service Request Update
- Additional states
- Additional fields on service list and definitions
For privacy and security reasons, all requests must use HTTPS.
FixMyStreet can also receive updates POSTed to it; the same format as would be returned below, posted as if we were the Open311 server receiving an update.
| Purpose | Fetch a list of recent updates to Requests |
|---|---|
| URL | https://[API endpoint]/servicerequestupdates.[format] |
| Sample URL | https://api.city.example.com/dev/v2.1/servicerequestupdates?start_date=2010-05-24T00:00:00Z&end_date=2010-06-24T00:00:00Z&jurisdiction_id=city.gov |
| Formats | XML (JSON available if denoted by Service Discovery) |
| HTTP Method | GET |
| Requires API Key | No |
| Field Name | Description | Notes & Requirements |
|---|---|---|
|
This is only required if the endpoint serves multiple jurisdictions |
| Field Name | Description | Notes & Requirements |
|---|---|---|
|
Earliest update to include in returned results | In W3 format |
|
Latest update to include in returned results | In W3 format |
| Field Name | Description | Notes & Requirements |
|---|---|---|
| service_request_updates ⇊ | ||
| request_update ↴ | ||
|
The ID of the service request update. | |
|
The ID of the service request that the update is for. | |
|
The status of the service request after the update. | Possible values: OPEN, CLOSED (though see our extension) |
|
The datetime of the update. | In W3 format |
|
The text of the update. | |
|
The URL of any associated media, e.g an image | |
The default query limit is a span of 24 hours or the first thousand requests, whichever is smallest.
The numbers represent the HTTP status code returned for each error type:
- 404 - jurisdiction_id not found
- 400 - jurisdiction_id was not provided
- 400 - General service error
<?xml version="1.0" encoding="utf-8"?>
<service_request_updates>
<request_update>
<update_id>20474</update_id>
<service_request_id>2934</service_request_id>
<status>OPEN</status>
<updated_datetime>2010-04-14T10:37:38-01:00</updated_datetime>
<description>This problem has been scheduled for inspection</description>
</request_update>
<request_update>
<update_id>20473</update_id>
<service_request_id>2937</service_request_id>
<status>OPEN</status>
<updated_datetime>2010-04-14T10:23:54-01:00</updated_datetime>
<description>An engineering team will be starting work shortly</description>
</request_update>
<request_update>
<update_id>20472</update_id>
<service_request_id>2930</service_request_id>
<status>CLOSED</status>
<updated_datetime>2010-04-14T10:07:45-01:00</updated_datetime>
<description>This pothole has been repaired.</description>
</request_update>
<request_update>
<update_id>20471</update_id>
<service_request_id>2934</service_request_id>
<status>OPEN</status>
<updated_datetime>2010-04-14T09:52:21-01:00</updated_datetime>
<description>Awaiting shceduling of inspection team.</description>
</request_update>
</service_request_updates>
| Purpose | Post an update to a service request |
|---|---|
| URL | https://[API endpoint]/servicerequestupdates.[format] |
| Sample URL | https://api.city.gov/dev/v2/servicerequestupdates.xml |
| Formats | XML (JSON available if denoted by Service Discovery) |
| HTTP Method | POST |
| Requires API Key | Yes |
| Field Name | Description | Notes & Requirements |
|---|---|---|
|
This is only required if the endpoint serves multiple jurisdictions | |
|
The id of the update | |
|
The ID of the service request the update is for | This should be the service_request_id returned from a previous POST ServiceRequest call |
|
The date and time of the update | In W3 format |
|
The status of the service request after the update | Possible values: OPEN or CLOSED (though see our extension) |
|
The message associated with the update |
| Field Name | Description | Notes & Requirements |
|---|---|---|
| The email address of the person leaving the update | ||
|
The phone number of the person leaving the update | |
|
The last name of the person leaving the update | |
|
The first name of the person leaving the update | |
|
The title of the person leaving the report | |
|
The URL of any associated media, e.g a photograph | |
|
The unique ID for the user account of the person submitting the update |
One user of this extension is slightly custom: It uses update_id_ext for the update ID,
and adds service_request_id_ext (this end's report ID), public_anonymity_required
(did the user ask for anonymity), and email_alerts_requested (did they ask to be alerted).
| Field Name | Description | Notes & Requirements |
|---|---|---|
| service_request_updates ⇊ | ||
| request_update ↴ | ||
|
The ID of the service request update. | This should not be returned if token is returned |
|
If returned use this to call GET update_id from a token. | This should not be returned if service_request_id is returned |
|
The unique ID for the user account of the person submitting the request | May not be returned |
The numbers represent the HTTP status code returned for each error type:
- 404 - jurisdiction_id or service_request_id not found (specified in error message)
- 400 - Required argument was not provided (specified in error message)
- 400 - General service error
POST /v2.1/servicerequestupdates.xml
HOST api.city.gov
Content-Tpe: application/x-www-form-urlencoded; charset=utf-8
api_key=xyz&jurisdiction_id=city.gov&update_id=13456&service_request_id=1934&status=OPEN&description=The+pothole+has+got+much+larger&updated_datetime=2010-04-14T10:33:11-01:00&email=user%40example.com&last_name=User&first_name=A
<?xml version="1.0" encoding="utf-8"?>
<service_request_updates>
<request_update>
<update_id>392732</update_id>
</request_update>
</service_request_updates>
| Conditional | Yes - This call is only necessary if the response from POST Service Request Update contains a token |
|---|---|
| Purpose | Get the update_id from a temporary token. This is unnecessary if the response from creating a service request update does not contain a token. |
| URL | https://[API endpoint]/update_tokens/[token id].[format] |
| Sample URL | https://api.city.gov/dev/v2.1/update_tokens/123456.xml?jurisdiction_id=city.gov |
| Formats | XML (JSON available if denoted by Service Discovery) |
| HTTP Method | GET |
| Requires API Key | No |
| Field Name | Description | Notes & Requirements |
|---|---|---|
|
This is only required if the endpoint serves multiple jurisdictions | |
|
This is obtained from the POST Service Request Update method |
The numbers represent the HTTP status code returned for each error type:
- 404 - jurisdiction_id or token not found (specified in error message)
- 400 - jurisdiction_id or token was not provided (specified in error message)
- 400 - General service error
<?xml version="1.0" encoding="utf-8"?>
<service_request_updates>
<request_update>
<update_id>392732</update_id>
<token>10393383</update_id>
</request_update>
</service_request_updates>
| Field Name | Description | Notes & Requirements |
|---|---|---|
| service_request_updates ⇊ | ||
| request_update ↴ | ||
|
The ID of the service request update. | |
|
The token used to make this call | |
See http://fixmystreet.org/ for documentation