-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathopenAPI3.0.yaml
1350 lines (1350 loc) · 36.1 KB
/
openAPI3.0.yaml
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
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.0
servers:
- description: 臺北市教育局單一身份驗證服務伺服器
url: https://ldap.tp.edu.tw/api/v2/
info:
version: '2.0'
title: tpeduSSO
description: |-
這是「臺北市教育局單一身份驗證服務」開發專案所提供的REST服務,用來提供各級學程教育開放資料,資料內容依照個資法規定劃分為:公開資料及個人資料。前者可使用專案授權取得,後者需透過使用者行使同意權方能取得,由於個人資料中包含有未滿13歲之學童個資,因此申請介接專案之廠商或學校,若服務對象包含13歲以下之學童,依法應取得家長之書面同意始能申請介接。
本服務依照各種不同應用場合,提供四種不同的授權方法進行資料介接:專案授權、個資授權、代理授權、特權專案。不同授權模式之使用時機說明如下:
專案授權:存取無需使用者介入之學校公開資料,此範圍之資料為移除個資之軌跡資料,當須揭露相關當事人時,以其 UUID 代替。UUID 可由個資授權及代理授權查詢出真實資料。
個資授權:存取教育人員個資,應經過個資當事人行使同意權才能取得。個資當事人隨時可以透過服務網站終止授權,當授權終止時介接專案將無法再取得當事人個資。
代理授權:由依法保存和運用個資之機關學校,因執行法定業務之需求,將其一部份業務委託廠商進行系統開發時,可以無需個資當事人同意利用其個資,詳細規定請參閱個資法。為滿足此需求,系統提供代理授權功能。使用方法為:學校系統管理人員透過服務網站建立個人存取金鑰,將個人存取金鑰交付廠商,廠商可透過此金鑰存取學校系統管理人員所設定之特定資料範圍。若學校要終止此項授權,只要透過服務網站移除該金鑰即可。代理授權對個資當事人權益的影響巨大,請務必進行法律諮詢後再實施。
特權專案:經教育局認定可以管理全域資料的專案。無需學校管理員或資料當事人之授權,可以進行全部資料操作。
security:
- proxy: []
- user:
- me
- email
- user
- idno
- profile
- account
- project:
- school
- admin
paths:
/school:
parameters:
- name: sid
in: query
description: 依照統計代碼搜尋學校
schema:
type: integer
- name: area
in: query
description: 依照行政區搜尋學校
schema:
type: string
- name: name
in: query
description: 依照全銜搜尋學校
schema:
type: string
get:
summary: 取得學校清單
security:
- project:
- school
description: 取得臺北市高中(含)以下各級學校清單
responses:
'200':
description: 學校清單
content:
application/json:
schema:
type: array
items:
type: object
properties:
o:
type: string
title: 學校網域代碼
st:
type: string
title: 學校所在行政區
tpUniformNumbers:
type: integer
title: 學校統計編號
"description":
type: string
title: 學校全銜
/school/{dc}:
parameters:
- name: dc
in: path
description: 學校網域代碼
required: true
schema:
type: string
get:
summary: 取得指定學校資料
security:
- project:
- school
responses:
'200':
description: 學校資料
content:
application/json:
schema:
$ref: '#/components/schemas/org'
patch:
summary: 修改學校資訊
security:
- project:
- proxy
requestBody:
content:
application/json:
schema:
type: object
properties:
fax:
title: 傳真號碼
type: string
tel:
title: 聯絡電話
type: string
ipv4:
title: 學校使用的 IPv4 網段
type: string
ipv6:
title: 學校使用的 IPv6 網段
type: string
admins:
title: 指派學校系統管理員
type: array
items:
type: string
ous:
type: array
items:
type: object
properties:
id:
title: 行政單位代號
type: string
name:
title: 行政單位名稱
type: string
roles:
title: 職務清單
type: array
items:
type: object
properties:
id:
title: 職務代號
type: string
name:
title: 職務名稱
type: string
subjects:
type: array
items:
type: object
properties:
id:
title: 課程(科目)代號
type: string
domain:
title: 學科領域
type: string
"title":
title: 課程(科目)名稱
type: string
classes:
type: array
items:
type: object
properties:
id:
title: 班級代號
type: string
name:
title: 班級名稱
type: string
responses:
'200':
description: 學校資料
content:
application/json:
schema:
$ref: '#/components/schemas/org'
/school/{dc}/people:
parameters:
- name: dc
in: path
description: 學校網域代碼
required: true
schema:
type: string
- name: idno
in: query
description: 依照身分證字號搜尋人員(包含:家長、學生、教師)
schema:
type: integer
- name: sysid
in: query
description: 依照校務行政系統編號(學號或教師編號)搜尋人員(包含:家長、學生、教師)
schema:
type: string
- name: type
in: query
description: 指定搜尋對象,例如:家長、學生、教師
schema:
type: string
- name: name
in: query
description: 依照姓名搜尋人員(包含:家長、學生、教師)
schema:
type: string
- name: gender
in: query
description: 指定搜尋對象的性別
schema:
type: string
- name: tel
in: query
description: 依照聯絡電話搜尋人員(包含:家長、學生、教師)
schema:
type: string
- name: email
in: query
description: 依照電子郵件地址搜尋人員(包含:家長、學生、教師)
schema:
type: string
get:
summary: 搜尋符合條件的人員
security:
- project:
- school
description: 通常 idno 和 sysid 會單獨使用,其他條件可以複合搜尋
responses:
'200':
description: 人員 UUID 清單
content:
application/json:
schema:
$ref: '#/components/schemas/uuid_list'
post:
summary: 新增人員
security:
- project:
- proxy
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/people_form'
responses:
'200':
description: 人員詳細資訊
content:
application/json:
schema:
$ref: '#/components/schemas/people'
/school/{dc}/people/{uuid}:
parameters:
- name: dc
in: path
description: 學校網域代碼
required: true
schema:
type: string
- name: uuid
in: path
description: 人員 UUID
required: true
schema:
type: string
format: uuid
get:
summary: 取得指定人員詳細資訊
security:
- project:
- proxy
responses:
'200':
description: 人員詳細資訊
content:
application/json:
schema:
$ref: '#/components/schemas/people'
patch:
summary: 修改指定人員詳細資訊
security:
- project:
- proxy
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/people_form'
responses:
'200':
description: 人員詳細資訊
content:
application/json:
schema:
$ref: '#/components/schemas/people'
delete:
summary: 修改指定人員詳細資訊
security:
- project:
- proxy
responses:
'200':
description: 人員已刪除
/school/{dc}/teachers:
parameters:
- name: dc
in: path
description: 學校網域代碼
required: true
schema:
type: string
get:
summary: 取得學校教師清單
security:
- project:
- school
responses:
'200':
description: 教師 UUID 清單
content:
application/json:
schema:
$ref: '#/components/schemas/uuid_list'
/school/{dc}/ou:
parameters:
- name: dc
in: path
description: 學校網域代碼
required: true
schema:
type: string
get:
summary: 取得行政單位清單
security:
- project:
- school
responses:
'200':
description: 行政單位清單
content:
application/json:
schema:
type: array
items:
type: object
properties:
ou:
type: string
title: 行政單位代號
"description":
type: string
title: 行政單位名稱
/school/{dc}/ou/{ou}:
parameters:
- name: dc
in: path
description: 學校網域代碼
required: true
schema:
type: string
- name: ou
in: path
description: 行政單位代號
required: true
schema:
type: string
get:
summary: 取得指定的行政單位資料
security:
- project:
- school
responses:
'200':
description: 行政單位資料
content:
application/json:
schema:
type: object
properties:
ou:
type: string
title: 行政單位代號
businessCategory:
type: string
title: 部門分類
"description":
type: string
title: 行政單位名稱
/school/{dc}/ou/{ou}/teachers:
parameters:
- name: dc
in: path
description: 學校網域代碼
required: true
schema:
type: string
- name: ou
in: path
description: 行政單位代號
required: true
schema:
type: string
get:
summary: 取得行政單位在職人員清單
security:
- project:
- school
responses:
'200':
description: 在職人員 UUID 清單
content:
application/json:
schema:
$ref: '#/components/schemas/uuid_list'
/school/{dc}/ou/{ou}/role:
parameters:
- name: dc
in: path
description: 學校網域代碼
required: true
schema:
type: string
- name: ou
in: path
description: 行政單位代號
required: true
schema:
type: string
get:
summary: 取得行政單位職務清單
security:
- project:
- school
responses:
'200':
description: 職務清單
content:
application/json:
schema:
type: array
items:
type: object
properties:
cn:
type: string
title: 職務代號
"description":
type: string
title: 職務名稱
/school/{dc}/ou/{ou}/role/{role}:
parameters:
- name: dc
in: path
description: 學校網域代碼
required: true
schema:
type: string
- name: ou
in: path
description: 行政單位代號
required: true
schema:
type: string
- name: role
in: path
description: 職務代號
required: true
schema:
type: string
get:
summary: 取得指定的職務資料
security:
- project:
- school
responses:
'200':
description: 職務資料
content:
application/json:
schema:
type: object
properties:
ou:
type: string
title: 行政單位代號
cn:
type: string
title: 職務代號
"description":
type: string
title: 職務名稱
/school/{dc}/ou/{ou}/role/{role}/teachers:
parameters:
- name: dc
in: path
description: 學校網域代碼
required: true
schema:
type: string
- name: ou
in: path
description: 行政單位代號
required: true
schema:
type: string
- name: role
in: path
description: 職務代號
required: true
schema:
type: string
get:
summary: 取得職務在職人員清單
security:
- project:
- school
responses:
'200':
description: 在職人員 UUID 清單
content:
application/json:
schema:
$ref: '#/components/schemas/uuid_list'
/school/{dc}/subject:
parameters:
- name: dc
in: path
description: 學校網域代碼
required: true
schema:
type: string
get:
summary: 取得課程(科目)清單
security:
- project:
- school
responses:
'200':
description: 課程(科目)清單
content:
application/json:
schema:
type: array
items:
type: object
properties:
tpSubject:
type: string
title: 課程(科目)代號
tpSubjectDomain:
type: string
title: 學科領域
"description":
type: string
title: 課程(科目)名稱
/school/{dc}/subject/{subject}:
parameters:
- name: dc
in: path
description: 學校網域代碼
required: true
schema:
type: string
- name: subject
in: path
description: 課程(科目)代碼
required: true
schema:
type: string
get:
summary: 取得課程(科目)資料
security:
- project:
- school
responses:
'200':
description: 課程(科目)資料
content:
application/json:
schema:
type: object
properties:
tpSubject:
type: string
title: 課程(科目)代號
tpSubjectDomain:
type: string
title: 學科領域
"description":
type: string
title: 課程(科目)名稱
/school/{dc}/subject/{subject}/teachers:
parameters:
- name: dc
in: path
description: 學校網域代碼
required: true
schema:
type: string
- name: subject
in: path
description: 課程(科目)代碼
required: true
schema:
type: string
get:
summary: 取得課程(科目)任課教師清單
security:
- project:
- school
responses:
'200':
description: 任課教師 UUID 清單
content:
application/json:
schema:
$ref: '#/components/schemas/uuid_list'
/school/{dc}/subject/{subject}/classes:
parameters:
- name: dc
in: path
description: 學校網域代碼
required: true
schema:
type: string
- name: subject
in: path
description: 課程(科目)代碼
required: true
schema:
type: string
get:
summary: 取得課程(科目)授課班級清單
security:
- project:
- school
responses:
'200':
description: 班級代號清單
content:
application/json:
schema:
type: array
items:
type: string
/school/{dc}/class:
parameters:
- name: dc
in: path
description: 學校網域代碼
required: true
schema:
type: string
get:
summary: 取得學校班級清單
security:
- project:
- school
responses:
'200':
description: 班級資料清單
content:
application/json:
schema:
type: array
items:
type: object
properties:
ou:
type: string
title: 班級代號
"description":
type: string
title: 班級名稱
grade:
type: integer
title: 年級
tutor:
title: 導師 UUID 清單
$ref: '#/components/schemas/uuid_list'
/school/{dc}/class/{class}:
parameters:
- name: dc
in: path
description: 學校網域代碼
required: true
schema:
type: string
- name: class
in: path
description: 班級代碼
required: true
schema:
type: string
get:
summary: 取得學校班級資料
security:
- project:
- school
responses:
'200':
description: 班級資料
content:
application/json:
schema:
type: object
properties:
ou:
type: string
title: 班級代號
"description":
type: string
title: 班級名稱
grade:
type: integer
title: 年級
tutor:
title: 導師 UUID 清單
$ref: '#/components/schemas/uuid_list'
/school/{dc}/class/{class}/students:
parameters:
- name: dc
in: path
description: 學校網域代碼
required: true
schema:
type: string
- name: class
in: path
description: 班級代碼
required: true
schema:
type: string
get:
summary: 取得班級學生清單
security:
- project:
- school
responses:
'200':
description: 學生 UUID 清單
content:
application/json:
schema:
$ref: '#/components/schemas/uuid_list'
/school/{dc}/class/{class}/parents:
parameters:
- name: dc
in: path
description: 學校網域代碼
required: true
schema:
type: string
- name: class
in: path
description: 班級代碼
required: true
schema:
type: string
get:
summary: 取得班級家長清單
security:
- project:
- school
responses:
'200':
description: 家長 UUID 清單
content:
application/json:
schema:
$ref: '#/components/schemas/uuid_list'
/school/{dc}/class/{class}/teachers:
parameters:
- name: dc
in: path
description: 學校網域代碼
required: true
schema:
type: string
- name: class
in: path
description: 班級代碼
required: true
schema:
type: string
get:
summary: 取得班級教師清單
security:
- project:
- school
responses:
'200':
description: 教師 UUID 清單
content:
application/json:
schema:
$ref: '#/components/schemas/uuid_list'
/school/{dc}/class/{class}/subjects:
parameters:
- name: dc
in: path
description: 學校網域代碼
required: true
schema:
type: string
- name: class
in: path
description: 班級代碼
required: true
schema:
type: string
get:
summary: 取得班級課程(授課科目)清單
security:
- project:
- school
responses:
'200':
description: 課程(科目)代號清單
content:
application/json:
schema:
type: array
items:
type: string
/email:
get:
summary: 取得登入者的電子郵件
security:
- project:
- user
responses:
'200':
description: 電子郵件
content:
application/json:
schema:
type: object
properties:
email:
title: 電子郵件
type: string
/me:
get:
summary: 取得登入者的姓名和電子郵件
security:
- project:
- user
responses:
'200':
description: 基本資訊
content:
application/json:
schema:
type: object
properties:
name:
title: 姓名
type: string
email:
title: 電子郵件
type: string
/idno:
get:
summary: 取得登入者的身分證字號
security:
- project:
- user
responses:
'200':
description: 身分證字號
content:
application/json:
schema:
type: object
properties:
idno:
title: 身分證字號
type: string
/user:
get:
summary: 取得登入者的一般資訊
security:
- project:
- user
responses:
'200':
description: 一般資訊
content:
application/json:
schema:
type: object
properties:
role:
title: 角色,例如:家長、學生、教師
type: string
uuid:
title: UUID
type: string
format: uuid
name:
title: 姓名
type: string
email:
title: 電子郵件
type: string
email_login:
title: 可使用電子郵件登入
type: boolean
mobile:
title: 手機號碼
type: string
mobile_login:
title: 可使用手機號碼登入
type: boolean
patch:
summary: 修改登入者的一般資訊
security:
- project:
- user
requestBody:
content:
application/json:
schema:
type: object
properties:
email:
title: 電子郵件地址
type: string
mobile:
title: 手機號碼
type: string
email_login:
title: 使用電子郵件登入
type: boolean
mobile_login:
title: 使用手機號碼登入
type: boolean
responses:
'200':
description: 處理結果
content:
application/json:
schema:
type: object
properties:
message:
type: string
/profile:
get:
summary: 取得登入者的身份識別資訊
security:
- project:
- user
responses:
'200':
description: 人員詳細資訊
content:
application/json:
schema:
$ref: '#/components/schemas/people'
/account:
patch:
summary: 修改登入者的帳號密碼
security:
- project:
- user
requestBody:
content:
application/json:
schema:
type: object
properties:
account:
title: 新帳號
type: string
password:
title: 新密碼
type: string
format: password
responses:
'200':
description: 處理結果
content:
application/json:
schema:
type: object
properties:
message:
type: string
/logout:
get:
security:
- project:
- user
responses:
'200':
description: 登出成功
/validate/{token}:
parameters:
- name: token
in: path
description: token 存取金鑰