-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapiary.apib
117 lines (97 loc) · 4.06 KB
/
apiary.apib
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
FORMAT: 1A
# roadReport
roadReport
The roadReport API is an eGov initatitive that supports the reporting of road issues/conditions to municipalities. Subscribers to this API can report issues, and receive a benefit for resolved issues.
## Incidents Collection [/incidents]
Incidents are reports of adverse road conditions reported by observers. The incident is investigated and resolved if necessary by the public works department
### List All Incidents [GET]
API consumers can request all incidents, or they can pass GPS coordinates to get incidents for a particular location.
+ Response 200 (application/json)
[
{
"location": {
"type": "Point",
"coordinates": [-122.4041,37.7831]},
"locationDescription": "Moscone Center",
"reporterID": "b5664f41-1856-45f9-aa59-cdb95b9ba058",
"numberOfReporters": 2,
"status": "SUBMITTED",
"dateResolved": "",
"incidentType": "Pothole",
"alarms": [
{
"alarmType": "flc-visual-cue",
"alarmCode": "flc-000302",
"reportLoc": "https://images.oraclecloud.com/95e66495-989a-419c-9726-4269c57b4225",
"level": "SEVERE"
}, {
"alarmType": "susp-accel-cue",
"alarmCode": "sus-00734",
"reportLoc": "",
"level": "SEVERE"
}
]
},
{
"incidentID": "a80c9164-4995-4f66-8020-2db4eba68998",
"location": {
"type": "Point",
"coordinates": [-122.4177,37.8080]},
"locationDescription": "Fisherman's Warf",
"reporterID": "b5664f41-1856-45f9-aa59-cdb95b9ba058",
"numberOfReporters": 5,
"status": "RESOLVED",
"dateResolved": "2017-08-05T08:40:51.620Z",
"incidentType": "Streetlight Out",
"alarms": [
{
"alarmType": "flc-visual-cue",
"alarmCode": "flc-000302",
"reportLoc": "https://images.oraclecloud.com/a80c9164-4995-4f66-8020-2db4eba68998",
"level": "MINOR"
}
]
}
]
### Create a New Incident [POST]
Devices can report incidents by calling this API providing the location, subscriber identification and incident information.
+ Request (application/json)
+ Headers
reporterID: b5664f41-1856-45f9-aa59-cdb95b9ba058
+ Body
{
"location": {
"type": "Point",
"coordinates": [-122.4041,37.7831]},
"incidentType": "Pothole",
"alarms": [
{
"alarmType": "flc-visual-cue",
"alarmCode": "flc-000302",
"reportLoc": "https://images.oraclecloud.com/95e66495-989a-419c-9726-4269c57b4225",
"level": "SEVERE"
}, {
"alarmType": "susp-accel-cue",
"alarmCode": "sus-00734",
"reportLoc": "",
"level": "SEVERE"
}
]
}
+ Response 201 (application/json)
+ Headers
Location: /incidents/59fb87bedc09570001b7b8b5
+ Body
{
"_updated": "Thu, 02 Nov 2017 21:01:50 GMT",
"_links": {
"self": {
"href": "incidents/59fb87bedc09570001b7b8b5",
"title": "Incident"
}
},
"_created": "Thu, 02 Nov 2017 21:01:50 GMT",
"_status": "OK",
"_id": "59fb87bedc09570001b7b8b5",
"_etag": "46c4b021424c68ebe521a25c08ced4da9f32438c"
}