-
Notifications
You must be signed in to change notification settings - Fork 3
/
city-sr-api.json
594 lines (594 loc) · 18.2 KB
/
city-sr-api.json
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
{
"openapi": "3.0.0",
"info": {
"title": "CCT Customer Service Requests",
"description": "API for interacting with City of Cape Town's eServices",
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
},
"version": "2.2"
},
"servers": [
{
"url": "https://qaeservices1.capetown.gov.za/coct/api",
"description": "Quality Assurance Server"
}
],
"tags": [
{
"name": "service_request_group",
"description": "Operations relating to the creation and retrieval of information relating to service requests."
},
{
"name": "config_group",
"description": "Operations relating to the configuration of service requests."
},
{
"name": "auth_group",
"description": "This process shows the flow of actions in which the application's authorization process is conducted, that identifies authenticated, non-authenticated user and defines security groups."
}
],
"paths": {
"/zcur-guest/login": {
"get": {
"tags": [
"auth_group"
],
"description": "Returns the MYSAPSSO2 authentication cookie to be used in subsequent requests.",
"parameters": [
{
"name": "cookie",
"in": "query",
"required": true,
"style": "form",
"explode": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"responses": {
"200": {
"description": "OK",
"headers": {
"set-cookie": {
"description": "Need to extract the MYSAPSSO2 cookie from this header, and pass it back in subsequent requests.",
"style": "simple",
"explode": true,
"schema": {
"type": "string"
}
}
}
}
},
"security": []
}
},
"/zsreq/session": {
"get": {
"tags": [
"auth_group"
],
"security": [
{
"cookieAuth": [],
"serviceAuth": []
}
],
"summary": "Returns a new session identifier, to be used in subsequent requests as the value for the X-Session header.",
"parameters": [],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json; charset=utf-8": {
"schema": {
"$ref": "#/components/schemas/Session_Schema"
}
}
}
}
}
}
},
"/zsreq/config/types": {
"get": {
"tags": [
"config_group"
],
"security": [
{
"cookieAuth": [],
"sessionAuth": [],
"serviceAuth": []
}
],
"summary": "Returns the full set of request types or codes, and their descriptions for the City's Service Requests.",
"parameters": [],
"responses": {
"200": {
"description": "ok",
"content": {
"application/json; charset=utf-8": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Config_Type_Schema"
}
}
}
}
},
"500": {
"description": "Error in retrieving all type codes and descriptions. (Internal)",
"content": {
"application/json; charset=utf-8": {
"schema": {
"$ref": "#/components/schemas/Error_Schema"
}
}
}
}
}
}
},
"/zsreq/config/subtypes": {
"get": {
"tags": [
"config_group"
],
"security": [
{
"cookieAuth": [],
"sessionAuth": [],
"serviceAuth": []
}
],
"summary": "Returns the full set of request types or codes, and their descriptions for the City's Service Requests.",
"parameters": [],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json; charset=utf-8": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Config_Subtype_Schema"
}
}
}
}
},
"500": {
"description": "Error in retrieving all type codes and descriptions. (Internal)",
"content": {
"application/json; charset=utf-8": {
"schema": {
"$ref": "#/components/schemas/Error_Schema"
}
}
}
}
}
}
},
"/zsreq/sr/{reference_no}": {
"get": {
"tags": [
"service_request_group"
],
"security": [
{
"cookieAuth": [],
"serviceAuth": [],
"sessionAuth": []
}
],
"summary": "This operation is used to retrieve the current state of a service request given the service request number.",
"parameters": [
{
"name": "reference_no",
"in": "path",
"description": "The reference number of the service request.",
"required": true,
"style": "simple",
"explode": false,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json; charset=utf-8": {
"schema": {
"$ref": "#/components/schemas/Request_Attributes_Lookup_Schema"
}
}
}
},
"500": {
"description": "Error in retrieving all type codes and descriptions. (Internal)",
"content": {
"application/json; charset=utf-8": {
"schema": {
"$ref": "#/components/schemas/Error_Schema"
}
}
}
}
}
}
},
"/zsreq/sr": {
"post": {
"tags": [
"service_request_group"
],
"security": [
{
"cookieAuth": [],
"serviceAuth": [],
"sessionAuth": [],
"signatureAuth": []
}
],
"summary": "This operation is used to create a service request in the City’s system.",
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Request_Attributes_Schema"
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Request_Attribute_Response_Schema"
}
}
}
},
"500": {
"description": "Error in retrieving all type codes and descriptions. (Internal)",
"content": {
"application/json; charset=utf-8": {
"schema": {
"$ref": "#/components/schemas/Error_Schema"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Error_Schema": {
"required": [
"code",
"message"
],
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
}
},
"Config_Type_Schema": {
"required": [
"name",
"type"
],
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "A description of the service or grouping represented by the code",
"example": "Animal carcass removal"
},
"type": {
"type": "integer",
"description": "A 4-character code identifying a specific grouping of services",
"example": 1001,
"minimum": 1000,
"maximum": 9999
}
}
},
"Config_Subtype_Schema": {
"required": [
"name",
"subtype",
"type"
],
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "A description of the service or grouping represented by the code",
"example": "Cat"
},
"type": {
"type": "integer",
"description": "A 4-digit code identifying a specific grouping of services",
"example": 1001,
"minimum": 1000,
"maximum": 9999
},
"subtype": {
"type": "integer",
"description": "A 4-digit code identifying an individual service",
"example": 1001,
"minimum": 1000,
"maximum": 9999
}
}
},
"Login_Schema": {
"required": [
"set-cookie"
],
"properties": {
"cookie": {
"type": "string",
"example": "k;X/`[AP\\K9Bc<H^vgCv_F.J8w9/%~+V"
}
}
},
"Session_Schema": {
"required": [
"session_id"
],
"properties": {
"session_id": {
"type": "string",
"example": "k;X/`[AP\\K9Bc<H^vgCv_F.J8w9/%~+V"
}
}
},
"Request_Attributes_Schema": {
"required": [
"type",
"subtype",
"message",
"latitude",
"longitude",
"telephone",
"comm",
"suburb",
"street",
"street_number"
],
"type": "object",
"properties": {
"type": {
"type": "integer",
"description": "A 4-digit code identifying a specific grouping of services. See path /zsreq/config/types for acceptable values.",
"example": 1001,
"minimum": 1000,
"maximum": 9999
},
"subtype": {
"type": "integer",
"description": "A 4-digit code identifying an individual service. See path /zsreq/config/subtypes for acceptable values.",
"example": 1002,
"minimum": 1000,
"maximum": 9999
},
"message": {
"type": "string",
"description": "The text describing the requested service as entered by the user.",
"example": "Please collect the whale carcass from Muizenberg beach"
},
"address": {
"type": "string",
"description": "The comma-delimited address of the location of the service request.",
"example": "1 Beach Road, Muizenberg"
},
"latitude": {
"type": "number",
"format": "float",
"description": "The latitude of the location of the issue (in decimal degrees)",
"minimum": -34.35,
"maximum": -33.47,
"example":-34.105420
},
"longitude": {
"type": "number",
"format": "float",
"description": "The longitude of the location of the issue (in decimal degrees)",
"minimum": 18.3,
"maximum": 19,
"example":18.474681
},
"email": {
"type": "string",
"format": "email",
"description": "Valid email address (required if comm is “email”)",
"example": "[email protected]"
},
"telephone": {
"type": "string",
"pattern": "^(\\+27|0)\\d{9}$",
"description": "Valid local mobile telephone number",
"example": "+27811234756"
},
"comm": {
"type": "string",
"description": "Communication preference. 'INT' is selects correspondence via email, 'SMS' is SMS text message via the telephone number.",
"enum": ["EMAIL", "SMS", "NONE"],
"example": "EMAIL"
},
"suburb": {
"type": "string",
"description": "The suburb name component of the location of the service request.",
"example": "Muizenberg"
},
"street": {
"type": "string",
"description": "The street name component of the location of the service request.",
"example": "Beach Rd"
},
"street_number": {
"type": "string",
"description": "The street number component of the location of the service request.",
"example": "1"
},
"firstName": {
"type": "string",
"pattern": "^.{0,40}$",
"description": "The first name of the contact person.",
"example": "Sipho"
},
"lastName": {
"type": "string",
"pattern": "^.{0,40}$",
"description": "The last name of the contact person.",
"example": "Daniels"
}
}
},
"Request_Attribute_Response_Schema": {
"required": [
"reference_number",
"category",
"message"
],
"type": "object",
"properties": {
"reference_number": {
"type": "string",
"description": "The reference number of the service request",
"example": "000010011101"
},
"category": {
"type": "string",
"description": "A description of the requested service category",
"example": "Animal carcass removal - Whale"
},
"message": {
"type": "string",
"description": "Text description including further details of the requested service and\nfeedback",
"example": "lease collect the whale carcass from Muizenberg beach before the wind direction\nchanges."
}
}
},
"Request_Attributes_Lookup_Schema": {
"required": [
"reference_number",
"type",
"subtype",
"description",
"status",
"message",
"time_created",
"date_created"
],
"type": "object",
"properties": {
"reference_number": {
"type": "string",
"example": "2101825"
},
"type": {
"type": "string",
"pattern": "^(\\d{4}|)$",
"description": "The four-digit code of the service group containing the selected service. See path /zsreq/config/types for possible values.",
"example": "1001"
},
"subtype": {
"type": "string",
"pattern": "^(\\d{4}|)$",
"description": "The four-digit code of the specific service selected. See path /zsreq/config/subtypes for possible values.",
"example": "1002"
},
"description": {
"type": "string",
"description": "A text description including further details of the requested service and feedback",
"example": "Animal carcass removal - Whale"
},
"status": {
"type": "string",
"description": "Current state of work",
"example": "Closed"
},
"message": {
"type": "string",
"description": "A text description including further details of the requested service and feedback",
"example": " Please collect the whale carcass from Muizenberg beach before the wind direction changes. 28.11.2014 11:20:13 Gareth Dohne (SC_GD1) The carcass Please collect the whale carcass from Muizenberg beach has been successfully removed from the beach and the surrounding area cleaned up."
},
"time_created": {
"type": "string",
"format": "partial-time",
"pattern": "^([0-1]\\d|2[0-3])\\:[0-5]\\d\\:[0-5]\\d$",
"description": "The ISO8601 compliant partial time (HH:MM:SS) at which the request was created. SAST timezone is implied.",
"example": "10:08:59"
},
"date_created": {
"type": "string",
"format": "city-custom-date",
"pattern": "^([0-2]\\d|3[0-1])\\.(0\\d|1[0-2])\\.\\d{4}$",
"description": "The date (NB not ISO8601 compliant, DD.MM.YYYY) on which the request was created. SAST timezone is implied.",
"example": "28.11.2014"
}
}
}
},
"responses": {
"Internal": {
"description": "Error in retrieving all type codes and descriptions. (Internal)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error_Schema"
}
}
}
}
},
"securitySchemes": {
"signatureAuth": {
"type": "apiKey",
"description": "Base 64 encoded, hexadecimal string of the HMAC SHA256 encoding of the message contents. See https://www.jokecamp.com/blog/examples-of-creating-base64-hashes-using-hmac-sha256-in-different-languages/ for examples of how to compute this for different languages.",
"name": "X-Signature",
"in": "header"
},
"cookieAuth": {
"type": "apiKey",
"description": "SAP Auth Cookie. See /coct/api/zcur-guest/login path for details on how to retrieve it.",
"name": "MYSAPSSO2",
"in": "cookie"
},
"serviceAuth": {
"type": "apiKey",
"description": "Session identifier. See /coct/api/zsreq/session on how to retrieve it",
"name": "X-Service",
"in": "header"
},
"sessionAuth": {
"type": "apiKey",
"description": "Service identifier (public key). Should have been issued with your creds",
"name": "X-Session",
"in": "header"
}
}
}
}