├── LICENSE.md
├── README.md
├── activity-service
└── v1
│ ├── activities.md
│ ├── announces.md
│ └── clubs.md
├── bus-service
└── v1
│ ├── providers.md
│ └── routes
│ ├── buses.md
│ ├── estimate_times.md
│ ├── routes.md
│ └── stops.md
├── calendar-service
└── v1
│ ├── categories.md
│ ├── event
│ ├── README.md
│ ├── delete.md
│ ├── get.md
│ ├── post.md
│ └── put.md
│ └── events.md
├── course-service
└── v1
│ ├── course
│ ├── course.md
│ ├── limit.md
│ └── search.md
│ ├── search
│ ├── departments_courses.md
│ ├── departments_targets.md
│ ├── summer.md
│ └── target.md
│ ├── status.md
│ ├── student
│ ├── rejected.md
│ ├── selected.md
│ └── tracking.md
│ └── unit
│ ├── college.md
│ └── college_department.md
├── location-service
└── v1
│ ├── buildings.md
│ ├── faculties.md
│ ├── places.md
│ ├── search.md
│ └── units.md
├── oauth-service
├── README.md
├── access_token.md
├── authorization_code.md
├── refresh_token.md
└── scope.md
└── personnel-service
└── v1
├── cards.md
└── info.md
/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) [2015] [Computer Center, National Central University]
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # API-Documentation
2 | Documentation for National Central University API
3 |
4 | ## Root URL
5 | ```
6 | https://api.cc.ncu.edu.tw
7 | ```
8 |
9 | ## Authorization
10 |
11 | Before you making any API calls, you have to register a client at [OAuth Management] first.
12 | There are two situations to use our API:
13 |
14 | - Access resources that contains personal information :
15 | 1. Follow the **OAuth 2.0** protocol to get an **access token**, see [documentation](oauth-service/README.md).
16 | 2. Read the [documentation](oauth-service/README.md) to use **access token**.
17 | - Access resources without personal information :
18 | 1. Get an **api token** from [OAuth Management].
19 | 2. Read the [documentation](oauth-service/README.md) to use **api token**.
20 |
21 | ## Internationalization
22 | Some NCU APIs are bilingual(zh-TW, en-US) and default to zh-TW. Use **Accept-Language** header to specify your language.
23 |
24 | ## Encoding
25 | All strings are encoded in UTF-8.
26 |
27 | ## Endpoints
28 |
29 | ##### [Activity-Service]
30 | > /activity/v1
31 | - [/activities](activity-service/v1/activities.md)
32 | - [/announces](activity-service/v1/announces.md)
33 | - [/clubs](activity-service/v1/clubs.md)
34 |
35 | ##### [Location-Service]
36 | > /location/v1
37 | - [/search](location-service/v1/search.md)
38 | - [/places](location-service/v1/places.md)
39 | - [/units](location-service/v1/units.md)
40 | - [/faculties](location-service/v1/faculties.md)
41 | - [/buildings](location-service/v1/buildings.md)
42 |
43 | ##### [Course-Service]
44 | > /course/v1
45 | - [/status](course-service/v1/status.md)
46 | - [/colleges](course-service/v1/unit/college.md)
47 | - [/colleges/{collegeId}/departments](course-service/v1/unit/college_department.md)
48 | - [/departments/{departmentId}/targets](course-service/v1/search/departments_targets.md)
49 | - [/departments/{departmentId}](course-service/v1/search/departments_courses.md)
50 | - [/courses/{serialNo}](course-service/v1/course/course.md)
51 | - [/courses/{serialNo}/limit](course-service/v1/course/limit.md)
52 | - [/courses](course-service/v1/course/search.md)
53 | - [/targets/{targetId}/courses](course-service/v1/search/target.md)
54 | - [/summer/{stage}/courses](course-service/v1/search/summer.md)
55 | - [/student/selected](course-service/v1/student/selected.md)
56 | - [/student/rejected](course-service/v1/student/rejected.md)
57 | - [/student/tracking](course-service/v1/student/tracking.md)
58 |
59 | ##### [Personnel-Service]
60 | > /personnel/v1
61 | - [/cards/{cardNumber}](personnel-service/v1/cards.md)
62 | - [/info](personnel-service/v1/info.md)
63 |
64 | ##### [Calendar-Service]
65 | > /calendar/v1
66 | - [/categories](calendar-service/v1/categories.md)
67 | - [/event](calendar-service/v1/event/)
68 | - [/events](calendar-service/v1/events.md)
69 |
70 | ##### [Bus-Service]
71 | > /bus/v1
72 | - [/routes/{routeId}/estimate_times](bus-service/v1/routes/estimate_times.md)
73 |
74 | ## Error Status Code
75 |
76 | HTTP Status Code | Description
77 | ---------------- | -----------------
78 | 400 | invalid body or parameter.
79 | 401 | access a protected resource with an invalid token.
80 | 403 | access a protected resource with an token from invalid client.
81 | 404 | resource not found.
82 | 405 | invalid request method
83 | 500 | internal server error.
84 |
85 | ## Problems?
86 | If you have any problems, please file a issue or just send us pull requests.
87 | Any pull requests submitted to master branch are not allowed, please submit to **develop** branch.
88 | It would be appreciated that with brief descriptions and some unit tests to proof.
89 |
90 | ## Format Reference
91 | The format of this document refer to [Documentation for University of Waterloo API](https://github.com/uWaterloo/api-documentation).
92 |
93 | ## License
94 | MIT License Copyright © 2015-2015 Computer Center, National Central University
95 |
96 | [OAuth Management]:https://api.cc.ncu.edu.tw/manage
97 | [Activity-Service]:https://github.com/NCU-CC/Activity-Service
98 | [Personnel-Service]:https://github.com/NCU-CC/Personnel-Service
99 | [Location-Service]:https://github.com/NCU-CC/Location-Service
100 | [Course-Service]:https://github.com/NCU-CC/Course-Service
101 | [Calendar-Service]:https://github.com/NCU-CC/Calendar-Service
102 | [Bus-Service]:https://github.com/NCU-CC/Bus-Service
103 |
--------------------------------------------------------------------------------
/activity-service/v1/activities.md:
--------------------------------------------------------------------------------
1 | # Find Activities
2 |
3 | ```
4 | GET /activities
5 | ```
6 |
7 | ## Description
8 | > Find the latest activities
9 |
10 | # Request
11 |
12 | ## Headers
13 |
14 |
15 | Name |
16 | Required |
17 | Description |
18 |
19 |
20 | X-NCU-API-TOKEN |
21 | yes |
22 | your API token |
23 |
24 |
25 | ## Query Parameters
26 |
27 |
28 | Name |
29 | Required |
30 | Description |
31 |
32 |
33 | size |
34 | no |
35 | fetch size, 1 ~ 40, default to 20 |
36 |
37 |
38 |
39 | ## Example
40 |
41 | ```
42 | GET /activities?size=3
43 | ```
44 |
45 | # Response
46 |
47 | ## Formats
48 | - json
49 |
50 | ## Structure
51 |
52 |
53 | Field Name |
54 | Type |
55 | Value Description |
56 |
57 |
58 | name |
59 | String |
60 | activity name |
61 |
62 |
63 | club |
64 | String |
65 | activity sponsor |
66 |
67 |
68 | place |
69 | String |
70 | activity place |
71 |
72 |
73 | content |
74 | String |
75 | activity content |
76 |
77 |
78 | start |
79 | String |
80 | activity start time |
81 |
82 |
83 | end |
84 | String |
85 | activity end time |
86 |
87 |
88 |
89 | ## Example
90 | ```json
91 | [
92 | {
93 | "name":"電機營輔訓",
94 | "club":"電機系學會",
95 | "place":"志道樓 - 一樓大活動室",
96 | "content":"試跑電機營第一天活動內容",
97 | "start":"2015-05-01 16:00",
98 | "end":"2015-05-01 22:00"
99 | },
100 | {
101 | "name":"成果展",
102 | "club":"手語社",
103 | "place":"志道樓 - 二樓小活動室",
104 | "content":"練習",
105 | "start":"2015-05-01 20:00",
106 | "end":"2015-05-01 22:00"
107 | },
108 | {
109 | "name":"中友週傳情",
110 | "club":"台中南投地區校友會",
111 | "place":"志道樓 - 擺攤宣傳區 66大順",
112 | "content":"舉辦傳情活動,藉由傳情的溫馨活動讓同學們可以傳達心意並且介紹台中美食,以增加社團之特色。",
113 | "start":"2015-05-01 12:00",
114 | "end":"2015-05-01 21:00"
115 | }
116 | ]
117 | ```
118 |
--------------------------------------------------------------------------------
/activity-service/v1/announces.md:
--------------------------------------------------------------------------------
1 | # Find Announces
2 |
3 | ```
4 | GET /announces
5 | ```
6 |
7 | ## Description
8 | > Find announces by condition
9 |
10 | # Request
11 |
12 | ## Headers
13 |
14 |
15 | Name |
16 | Required |
17 | Description |
18 |
19 |
20 | X-NCU-API-TOKEN |
21 | yes |
22 | your API token |
23 |
24 |
25 | ## Query Parameters
26 |
27 |
28 | Name |
29 | Required |
30 | Description |
31 |
32 |
33 | size |
34 | no |
35 | fetch size, 1 ~ 40, default to 20 |
36 |
37 |
38 | type |
39 | yes |
40 | announce type |
41 |
42 |
43 | older_than |
44 | no |
45 | query announces older than specified id |
46 |
47 |
48 | newer_than |
49 | no |
50 | query announces newer than specified id |
51 |
52 |
53 |
54 | if **older_than** and **newer_than** are presented at same time, only **older_than** is considered
55 |
56 | ## Announce Type
57 |
58 |
59 |
60 | type |
61 | description |
62 |
63 |
64 | common |
65 | 一般公告 |
66 |
67 |
68 | group |
69 | 組務公告 |
70 |
71 |
72 |
73 | ## Example
74 |
75 | ```
76 | GET /announces?size=2&type=common ( latest announces with common type )
77 | ```
78 |
79 | ```
80 | GET /announces?size=2&type=group&older_than=10 ( group announces older than the announce whose id = 10 )
81 | ```
82 |
83 | # Response
84 |
85 | ## Formats
86 | - json
87 |
88 | ## Structure
89 |
90 |
91 | Field Name |
92 | Type |
93 | Value Description |
94 |
95 |
96 | id |
97 | Integer |
98 | announce id |
99 |
100 |
101 | title |
102 | String |
103 | announce title |
104 |
105 |
106 | content |
107 | String |
108 | announce content |
109 |
110 |
111 | time |
112 | String |
113 | announce created time |
114 |
115 |
116 | attachment |
117 | String |
118 | announce attachement url |
119 |
120 |
121 |
122 | ## Example
123 | ```json
124 | [
125 | {
126 | "id":1,
127 | "title":"變形金剛-舞台車車體視覺設計競圖大賽",
128 | "content":"內容",
129 | "time":"2015-05-01 15:42",
130 | "attachment": "http://www.api.com/file/file1.txt"
131 | },
132 | {
133 | "id":2,
134 | "title":"2015德明盃3D超商全國經營管理",
135 | "content":"內容",
136 | "time":"2015-05-01 15:28",
137 | "attachment":null
138 | }
139 | ]
140 | ```
141 |
142 | ```json
143 | [[
144 | {
145 | "id":9,
146 | "title":"百年校慶創意市集攤位招募中",
147 | "content":"內容",
148 | "time":"2015-04-28 16:13",
149 | "attachment":null
150 | },
151 | {
152 | "id":6,
153 | "title":"103-2社團指導老師「授課費用」核定結果",
154 | "content":"內容",
155 | "time":"2015-04-09 14:19",
156 | "attachment":null
157 | }
158 | ]]
159 | ```
160 |
--------------------------------------------------------------------------------
/activity-service/v1/clubs.md:
--------------------------------------------------------------------------------
1 | # Find Clubs
2 |
3 | ```
4 | GET /clubs
5 | ```
6 |
7 | ## Description
8 | > Find all clubs
9 |
10 | # Request
11 |
12 | ## Headers
13 |
14 |
15 | Name |
16 | Required |
17 | Description |
18 |
19 |
20 | X-NCU-API-TOKEN |
21 | yes |
22 | your API token |
23 |
24 |
25 |
26 | ## Example
27 |
28 | ```
29 | GET /clubs
30 | ```
31 |
32 | # Response
33 |
34 | ## Formats
35 | - json
36 |
37 | ## Structure
38 |
39 |
40 | Field Name |
41 | Type |
42 | Value Description |
43 |
44 |
45 | name |
46 | String |
47 | club name |
48 |
49 |
50 | description |
51 | String |
52 | club description |
53 |
54 |
55 | place |
56 | String |
57 | club working place |
58 |
59 |
60 | website |
61 | String |
62 | club website |
63 |
64 |
65 |
66 | ## Example
67 | ```json
68 | [
69 | {
70 | "name":"國文系學會",
71 | "description":"描述",
72 | "place":"國文系館",
73 | "website":"http://www.example.com"
74 | },
75 | {
76 | "name":"英文系學會",
77 | "description":"描述",
78 | "place":"英文系館",
79 | "website":"http://www.example.com"
80 | }
81 | ]
82 | ```
83 |
--------------------------------------------------------------------------------
/bus-service/v1/providers.md:
--------------------------------------------------------------------------------
1 | # Get Providers of Bus
2 |
3 | ```
4 | GET /providers
5 | ```
6 |
7 | ## Description
8 | > Get all providers of bus
9 |
10 | # Request
11 | ## Headers
12 |
13 |
14 | Name |
15 | Required |
16 | Description |
17 |
18 |
19 | X-NCU-API-TOKEN |
20 | yes |
21 | Your API token |
22 |
23 |
24 |
25 | ## Example
26 | ```
27 | GET /providers
28 | ```
29 |
30 | # Response
31 |
32 | ## Formats
33 | - json
34 |
35 | ## Example
36 | ```json
37 | {
38 | "BusDynInfo": {
39 | "EssentialInfo": {
40 | "CoordinateSystem": "",
41 | "UpdateTime": "2015-12-25 00:00:00",
42 | "Location": {
43 | "CenterName": "Maxwin",
44 | "name": "TYBUS"
45 | }
46 | },
47 | "BusInfo": {
48 | "Provider": [
49 | {
50 | "nameZh": "桃園客運",
51 | "ID": 1,
52 | "type": 0
53 | },
54 | {
55 | "nameZh": "中壢客運",
56 | "ID": 2,
57 | "type": 0
58 | },
59 | {
60 | "nameZh": "統聯客運",
61 | "ID": 4,
62 | "type": 0
63 | },
64 | {
65 | "nameZh": "新竹客運",
66 | "ID": 5,
67 | "type": 0
68 | },
69 | {
70 | "nameZh": "亞通客運",
71 | "ID": 6,
72 | "type": 0
73 | },
74 | {
75 | "nameZh": "金台通運(免巴)",
76 | "ID": 8,
77 | "type": 2
78 | },
79 | {
80 | "nameZh": "桃園客運(免巴)",
81 | "ID": 21,
82 | "type": 2
83 | },
84 | {
85 | "nameZh": "亞通客運(免巴)",
86 | "ID": 22,
87 | "type": 2
88 | }
89 | ]
90 | }
91 | }
92 | }
93 | ```
--------------------------------------------------------------------------------
/bus-service/v1/routes/buses.md:
--------------------------------------------------------------------------------
1 | # Get Buses Info of Specific Route
2 |
3 | ```
4 | GET /routes/{routeId}/buses
5 | ```
6 |
7 | ## Description
8 | > Get buses info of specific route
9 |
10 | # Request
11 | ## Headers
12 |
13 |
14 | Name |
15 | Required |
16 | Description |
17 |
18 |
19 | X-NCU-API-TOKEN |
20 | yes |
21 | Your API token |
22 |
23 |
24 |
25 | ## Variables
26 |
27 |
28 | Name |
29 | Description |
30 |
31 |
32 | routeId |
33 | specific route id |
34 |
35 |
36 |
37 | **※ routeId can only be one of 133 `(133)`, 3220 `(132)`, 3221 `(172)`, 3222 `(132_A)`**
38 |
39 | ## Example
40 | ```
41 | GET /routes/3220/buses
42 | ```
43 |
44 | # Response
45 |
46 | ## Formats
47 | - json
48 |
49 | ## Example
50 | ```json
51 | {
52 | "BusDynInfo": {
53 | "EssentialInfo": {
54 | "Location": {
55 | "CenterName": "",
56 | "CoordinateSystem": "",
57 | "name": "Maxwin",
58 | "UpdateTime": "2015-12-25 00:00:00"
59 | }
60 | },
61 | "BusInfo": {
62 | "BusData": [
63 | {
64 | "ProviderID": 1,
65 | "Speed": 0,
66 | "BusID": "585-FD_o",
67 | "ledstate": 0,
68 | "Latitude": 24.940469,
69 | "DataTime": "2015-12-30 13:44:45",
70 | "RouteID": 3220,
71 | "GoBack": 2,
72 | "Longitude": 121.223892,
73 | "sections": 1,
74 | "Azimuth": 352,
75 | "DutyStatus": 0,
76 | "BusStatus": 98
77 | }
78 | ]
79 | }
80 | }
81 | }
82 | ```
83 |
--------------------------------------------------------------------------------
/bus-service/v1/routes/estimate_times.md:
--------------------------------------------------------------------------------
1 | # Get Bus Estimate Times of Specific Route
2 |
3 | ```
4 | GET /routes/{routeId}/estimate_times
5 | ```
6 |
7 | ## Description
8 | > Get bus estimate times of specific route
9 |
10 | # Request
11 | ## Headers
12 |
13 |
14 | Name |
15 | Required |
16 | Description |
17 |
18 |
19 | X-NCU-API-TOKEN |
20 | yes |
21 | Your API token |
22 |
23 |
24 |
25 | ## Variables
26 |
27 |
28 | Name |
29 | Description |
30 |
31 |
32 | routeId |
33 | specific route id |
34 |
35 |
36 |
37 | **※ routeId can only be one of 133 `(133)`, 3220 `(132)`, 3221 `(172)`, 3222 `(132_A)`**
38 |
39 | ## Example
40 | ```
41 | GET /routes/3220/estimate_times
42 | ```
43 |
44 | # Response
45 |
46 | ## Formats
47 | - json
48 |
49 | ## Example
50 | ```json
51 | {
52 | "BusDynInfo": {
53 | "EssentialInfo": {
54 | "Location": {
55 | "CenterName": "",
56 | "CoordinateSystem": "",
57 | "name": "Maxwin",
58 | "UpdateTime": "2015-12-25 00:00:00"
59 | }
60 | },
61 | "BusInfo": {
62 | "Route": {
63 | "EstimateTime": [
64 | {
65 | "StopName": "中壢公車站",
66 | "ests": "",
67 | "StopID": "0180",
68 | "seqNo": 1,
69 | "IVRNO": 180,
70 | "GoBack": 1,
71 | "comeTime": "14:30",
72 | "SID": 5642,
73 | "carId": "",
74 | "schId": "851336_1_20151230143000",
75 | "comeCarid": "",
76 | "Value": null,
77 | "EXTVoiceNo": "0578"
78 | },
79 | {
80 | "StopName": "第一銀行",
81 | "ests": "",
82 | "StopID": "0565",
83 | "seqNo": 2,
84 | "IVRNO": 565,
85 | "GoBack": 1,
86 | "comeTime": "14:30",
87 | "SID": 1200,
88 | "carId": "",
89 | "schId": "851336_1_20151230143000",
90 | "comeCarid": "",
91 | "Value": null,
92 | "EXTVoiceNo": "0588"
93 | }
94 | ],
95 | "id": 3220
96 | }
97 | }
98 | }
99 | }
100 | ```
101 |
--------------------------------------------------------------------------------
/bus-service/v1/routes/routes.md:
--------------------------------------------------------------------------------
1 | # Get Routes of Bus
2 |
3 | ```
4 | GET /routes
5 | ```
6 |
7 | ## Description
8 | > Get all routes of bus
9 |
10 | # Request
11 | ## Headers
12 |
13 |
14 | Name |
15 | Required |
16 | Description |
17 |
18 |
19 | X-NCU-API-TOKEN |
20 | yes |
21 | Your API token |
22 |
23 |
24 |
25 | ## Example
26 | ```
27 | GET /routes
28 | ```
29 |
30 | # Response
31 |
32 | ## Formats
33 | - json
34 |
35 | ## Example
36 | ```json
37 | {
38 | "BusDynInfo": {
39 | "EssentialInfo": {
40 | "CoordinateSystem": "",
41 | "UpdateTime": "2015-12-25 00:00:00",
42 | "Location": {
43 | "CenterName": "Maxwin",
44 | "name": "TYBUS"
45 | }
46 | },
47 | "BusInfo": {
48 | "Route": [
49 | {
50 | "ProviderId": 1,
51 | "departureZh": "中壢",
52 | "gxcode": 3010,
53 | "RouteType": "RTY",
54 | "MasterRouteDesc": "RG",
55 | "ddesc": "中壢<->桃園",
56 | "nameZh": 1,
57 | "destinationZh": "桃園",
58 | "MasterRouteNo": "",
59 | "ID": 3010,
60 | "MasterRouteName": " "
61 | }
62 | ]
63 | }
64 | }
65 | }
66 | ```
--------------------------------------------------------------------------------
/bus-service/v1/routes/stops.md:
--------------------------------------------------------------------------------
1 | # Get Bus Stop Info of Specific Route
2 |
3 | ```
4 | GET /routes/{routeId}/stops
5 | ```
6 |
7 | ## Description
8 | > Get bus stop info of specific route
9 |
10 | # Request
11 | ## Headers
12 |
13 |
14 | Name |
15 | Required |
16 | Description |
17 |
18 |
19 | X-NCU-API-TOKEN |
20 | yes |
21 | Your API token |
22 |
23 |
24 |
25 | ## Variables
26 |
27 |
28 | Name |
29 | Description |
30 |
31 |
32 | routeId |
33 | specific route id |
34 |
35 |
36 |
37 | **※ routeId can only be one of 133 `(133)`, 3220 `(132)`, 3221 `(172)`, 3222 `(132_A)`**
38 |
39 | ## Example
40 | ```
41 | GET /routes/3220/stops
42 | ```
43 |
44 | # Response
45 |
46 | ## Formats
47 | - json
48 |
49 | ## Example
50 | ```json
51 | {
52 | "BusDynInfo": {
53 | "EssentialInfo": {
54 | "CoordinateSystem": "",
55 | "UpdateTime": "2015-12-25 00:00:00",
56 | "Location": {
57 | "CenterName": "Maxwin",
58 | "name": "TYBUS"
59 | }
60 | },
61 | "BusInfo": {
62 | "Stop": [
63 | {
64 | "routeId": 3220,
65 | "districtId": 1,
66 | "seqNo": 1,
67 | "nameZh": "中壢公車站",
68 | "latitude": 24.953233,
69 | "pgp": 0,
70 | "Id": "0578",
71 | "terminal": 0,
72 | "GoBack": 1,
73 | "EXTVoiceNO": 578,
74 | "longitude": 121.224153,
75 | "SID": 5642
76 | },
77 | {
78 | "routeId": 3220,
79 | "districtId": 1,
80 | "seqNo": 2,
81 | "nameZh": "第一銀行",
82 | "latitude": "24.955120",
83 | "pgp": 0,
84 | "Id": "0588",
85 | "terminal": 0,
86 | "GoBack": 1,
87 | "EXTVoiceNO": 588,
88 | "longitude": 121.222093,
89 | "SID": 1200
90 | }
91 | ]
92 | }
93 | }
94 | }
95 | ```
96 |
--------------------------------------------------------------------------------
/calendar-service/v1/categories.md:
--------------------------------------------------------------------------------
1 | # Get Categories
2 |
3 | ```
4 | GET /categories
5 | ```
6 |
7 | ## Description
8 | > Return categories.
9 |
10 | # Request
11 |
12 | ## Headers
13 |
14 |
15 | Name |
16 | Required |
17 | Description |
18 |
19 |
20 | Authorization |
21 | yes |
22 | Bearer token |
23 |
24 |
25 |
26 | ## Example
27 |
28 | ```
29 | GET /categories
30 | ```
31 |
32 | # Response
33 |
34 | ## Formats
35 | - json
36 |
37 | ## Structure
38 |
39 |
40 | Field Name |
41 | Type |
42 | Value Description |
43 |
44 |
45 | categories |
46 | array |
47 | A list of Category. |
48 |
49 |
50 |
51 | ### Category
52 |
53 |
54 | Field Name |
55 | Type |
56 | Value Description |
57 |
58 |
59 | id |
60 | integer |
61 | Category identifier. |
62 |
63 |
64 | name |
65 | string |
66 | Name of category. |
67 |
68 |
69 | calendar_id |
70 | string |
71 | Calendar identifier of Google Calendar. |
72 |
73 |
74 | addible |
75 | boolean |
76 | Whether this category is addible. |
77 |
78 |
79 |
80 | ## Example
81 | ```json
82 | {
83 | "categories": [
84 | {
85 | "id": 1,
86 | "name": "校曆",
87 | "calendar_id": "vul4xu4@group.calendar.google.com",
88 | "addible": false
89 | },
90 | {
91 | "id": 2,
92 | "name": "教職員",
93 | "calendar_id": "rul456m06@group.calendar.google.com",
94 | "addible": true
95 | },
96 | {
97 | "id": 3,
98 | "name": "學生",
99 | "calendar_id": "vm6g@group.calendar.google.com",
100 | "addible": true
101 | }
102 | ]
103 | }
104 | ```
105 |
--------------------------------------------------------------------------------
/calendar-service/v1/event/README.md:
--------------------------------------------------------------------------------
1 | # Operations about event
2 | - [POST /event](post.md)
3 | - [GET /event](get.md)
4 | - [PUT /event](put.md)
5 | - [DELETE /event](delete.md)
6 |
7 | # Structure
8 |
9 |
10 | Field Name |
11 | Type |
12 | Value Description |
13 |
14 |
15 | id |
16 | string |
17 | Event identifier. |
18 |
19 |
20 | created_at |
21 | string |
22 | Creation time of the event. |
23 |
24 |
25 | update_at |
26 | string |
27 | Last modification time of the event. |
28 |
29 |
30 | summary |
31 | string |
32 | Title of the event. |
33 |
34 |
35 | description |
36 | string |
37 | Description of the event. |
38 |
39 |
40 | location |
41 | string |
42 | Geographic location of the event. |
43 |
44 |
45 | category |
46 | string |
47 | Category of the event. |
48 |
49 |
50 | start |
51 | string |
52 | The start time of the event. |
53 |
54 |
55 | end |
56 | string |
57 | The end time of the event. |
58 |
59 |
60 | link |
61 | string |
62 | URL link of the event. |
63 |
64 |
65 |
66 | # Example
67 | ```json
68 | {
69 | "id": "5o4510qqjm3ccjd4k7i0fu15so",
70 | "created_at": "2015-11-03T07:13:41.230+08:00",
71 | "updated_at": "2015-11-03T07:13:41.230+08:00",
72 | "summary": "Test Summary",
73 | "description": "Test Description",
74 | "location": "Test Location",
75 | "category": "學生",
76 | "start": "2016-01-01T08:00:00.000+08:00",
77 | "end": "2016-01-01T09:00:00.000+08:00",
78 | "link": "http://example.com"
79 | }
80 | ```
81 |
--------------------------------------------------------------------------------
/calendar-service/v1/event/delete.md:
--------------------------------------------------------------------------------
1 | # Delete Event
2 |
3 | ```
4 | DELETE /event
5 | ```
6 |
7 | ## Description
8 | > Deletes an event.
9 |
10 | ## Required Scope
11 | - calendar.event.write
12 |
13 | # Request
14 |
15 | ## Headers
16 |
17 |
18 | Name |
19 | Required |
20 | Description |
21 |
22 |
23 | Authorization |
24 | yes |
25 | Bearer token. |
26 |
27 |
28 |
29 | ## Query Parameters
30 |
31 |
32 |
33 | Name |
34 | Required |
35 | Description |
36 | Data Type |
37 |
38 |
39 | id |
40 | yes |
41 | Event identifier. |
42 | string |
43 |
44 |
45 |
46 | ## Example
47 | ```
48 | DELETE /event?id=5o4510qqjm3ccjd4k7i0fu15so
49 | ```
50 |
51 | # Response
52 |
53 | ## Formats
54 | - json
55 |
56 | ## Structure
57 | [Event Objects](README.md#structure)
58 |
59 | ## Example
60 | [Event Example](README.md#example)
61 |
--------------------------------------------------------------------------------
/calendar-service/v1/event/get.md:
--------------------------------------------------------------------------------
1 | # Read Event
2 |
3 | ```
4 | Get /event
5 | ```
6 |
7 | ## Description
8 | > Returns an event.
9 |
10 | ## Required Scope
11 | - calendar.event.read
12 |
13 | # Request
14 |
15 | ## Headers
16 |
17 |
18 | Name |
19 | Required |
20 | Description |
21 |
22 |
23 | Authorization |
24 | yes |
25 | Bearer token. |
26 |
27 |
28 |
29 | ## Query Parameters
30 |
31 |
32 |
33 | Name |
34 | Required |
35 | Description |
36 | Data Type |
37 |
38 |
39 | id |
40 | yes |
41 | Event identifier. |
42 | string |
43 |
44 |
45 |
46 | ## Example
47 | ```
48 | GET /event?id=5o4510qqjm3ccjd4k7i0fu15so
49 | ```
50 |
51 | # Response
52 |
53 | ## Formats
54 | - json
55 |
56 | ## Structure
57 | [Event Objects](README.md#structure)
58 |
59 | ## Example
60 | [Event Example](README.md#example)
61 |
--------------------------------------------------------------------------------
/calendar-service/v1/event/post.md:
--------------------------------------------------------------------------------
1 | # Create Event
2 |
3 | ```
4 | POST /event
5 | ```
6 |
7 | ## Description
8 | > Creates an event.
9 |
10 | ## Required Scope
11 | - calendar.event.write
12 |
13 | # Request
14 |
15 | ## Headers
16 |
17 |
18 | Name |
19 | Required |
20 | Description |
21 |
22 |
23 | Authorization |
24 | yes |
25 | Bearer token. |
26 |
27 |
28 |
29 | ## Form-Data Parameters
30 |
31 |
32 |
33 | Name |
34 | Required |
35 | Description |
36 | Data Type |
37 |
38 |
39 | summary |
40 | yes |
41 | Title of the event. |
42 | string |
43 |
44 |
45 | description |
46 | yes |
47 | Description of the event. |
48 | string |
49 |
50 |
51 | link |
52 | no |
53 | URL link of the event. |
54 | string |
55 |
56 |
57 | location |
58 | yes |
59 | Geographic location of the event. |
60 | string |
61 |
62 |
63 | category |
64 | yes |
65 | Category of the event. |
66 | string |
67 |
68 |
69 | start |
70 | yes |
71 | The start time of the event. |
72 | date-time |
73 |
74 |
75 | end |
76 | yes |
77 | The end time of the event. |
78 | date-time |
79 |
80 |
81 |
82 | ## Example
83 | ```
84 | POST /event
85 | summary=Test%20Summary&description=Test%20Description&link=http%3A%2F%2Fexample.com&location=Test%20Location&category=%E5%AD%B8%E7%94%9F&start=2016-01-01T00%3A00%3A00.000Z&end=2016-01-01T01%3A00%3A00.000Z
86 | ```
87 |
88 | # Response
89 |
90 | ## Formats
91 | - json
92 |
93 | ## Structure
94 | [Event Objects](README.md#structure)
95 |
96 | ## Example
97 | [Event Example](README.md#example)
98 |
--------------------------------------------------------------------------------
/calendar-service/v1/event/put.md:
--------------------------------------------------------------------------------
1 | # Update Event
2 |
3 | ```
4 | PUT /event
5 | ```
6 |
7 | ## Description
8 | > Updates an event.
9 |
10 | ## Required Scope
11 | - calendar.event.write
12 |
13 | # Request
14 |
15 | ## Headers
16 |
17 |
18 | Name |
19 | Required |
20 | Description |
21 |
22 |
23 | Authorization |
24 | yes |
25 | Bearer token. |
26 |
27 |
28 |
29 | ## Form-Data Parameters
30 |
31 |
32 |
33 | Name |
34 | Required |
35 | Description |
36 | Data Type |
37 |
38 |
39 | id |
40 | yes |
41 | Event identifier. |
42 | string |
43 |
44 |
45 | summary |
46 | no |
47 | Title of the event. |
48 | string |
49 |
50 |
51 | description |
52 | no |
53 | Description of the event. |
54 | string |
55 |
56 |
57 | link |
58 | no |
59 | URL link of the event. |
60 | string |
61 |
62 |
63 | location |
64 | no |
65 | Geographic location of the event. |
66 | string |
67 |
68 |
69 | start |
70 | no |
71 | The start time of the event. |
72 | date-time |
73 |
74 |
75 | end |
76 | no |
77 | The end time of the event. |
78 | date-time |
79 |
80 |
81 |
82 | ## Example
83 | ```
84 | PUT /event
85 | id=5o4510qqjm3ccjd4k7i0fu15so&summary=Test%20Summary&description=Test%20Description&link=http%3A%2F%2Fexample.com&location=Test%20Location&start=2016-01-01T00%3A00%3A00.000Z&end=2016-01-01T01%3A00%3A00.000Z
86 | ```
87 |
88 | # Response
89 |
90 | ## Formats
91 | - json
92 |
93 | ## Structure
94 | [Event Objects](README.md#structure)
95 |
96 | ## Example
97 | [Event Example](README.md#example)
98 |
--------------------------------------------------------------------------------
/calendar-service/v1/events.md:
--------------------------------------------------------------------------------
1 | # Read Events
2 |
3 | ```
4 | GET /events
5 | ```
6 |
7 | ## Description
8 | > Returns events.
9 |
10 | ## Required Scope
11 | - calendar.event.read
12 |
13 | # Request
14 |
15 | ## Headers
16 |
17 |
18 | Name |
19 | Required |
20 | Description |
21 |
22 |
23 | Authorization |
24 | yes |
25 | Bearer token. |
26 |
27 |
28 |
29 | ## Query Parameters
30 |
31 |
32 |
33 | Name |
34 | Required |
35 | Description |
36 | Data Type |
37 |
38 |
39 | from |
40 | yes |
41 | Lower bound (inclusive) to filter by. |
42 | date-time |
43 |
44 |
45 | to |
46 | yes |
47 | Upper bound (exclusive) to filter by. |
48 | date-time |
49 |
50 |
51 | limit |
52 | no |
53 | Maximum number of events returned on one result page. (Default: 5) |
54 | integer |
55 |
56 |
57 | page |
58 | no |
59 | Which result page to return. (Default: 1) |
60 | integer |
61 |
62 |
63 | category |
64 | no |
65 | Category of events to filter by. |
66 | string |
67 |
68 |
69 | orderBy |
70 | no |
71 | The order of the events returned in the result and filter by. The value must be "start", "end", "created_at" or "updated_at". (Default: start) |
72 | string |
73 |
74 |
75 |
76 | ## Example
77 | ```
78 | GET /events?from=2015-01-01T00%3A00%3A00.000Z&to=2016-01-01T00%3A00%3A00.000Z&limit=5&page=1&category=%E5%AD%B8%E7%94%9F&orderBy=start
79 | ```
80 |
81 | # Response
82 |
83 | ## Formats
84 | - json
85 |
86 | ## Structure
87 |
88 |
89 | Field Name |
90 | Type |
91 | Value Description |
92 |
93 |
94 | events |
95 | array |
96 | List of Event Objects |
97 |
98 |
99 | count |
100 | integer |
101 | Number of events. |
102 |
103 |
104 | page |
105 | integer |
106 | Page number of events. |
107 |
108 |
109 |
110 |
111 | ## Example
112 | ```json
113 | {
114 | "events": [
115 | {
116 | "id": "a2frtf13cuaqhit9pf26lqmvr4",
117 | "created_at": "2015-11-03T07:45:34.000+08:00",
118 | "updated_at": "2015-11-03T07:45:34.000+08:00",
119 | "summary": "Test Summary1",
120 | "description": "Test Description1",
121 | "location": "Test Location1",
122 | "category": "學生",
123 | "start": "2016-01-01T08:00:00.000+08:00",
124 | "end": "2016-07-01T09:00:00.000+08:00",
125 | "link": "http://example1.com"
126 | },
127 | {
128 | "id": "bitvsriapjap4023c75d7mints",
129 | "created_at": "2015-11-03T07:45:54.000+08:00",
130 | "updated_at": "2015-11-03T07:45:54.000+08:00",
131 | "summary": "Test Summary2",
132 | "description": "Test Description2",
133 | "location": "Test Location2",
134 | "category": "學生",
135 | "start": "2016-07-01T08:00:00.000+08:00",
136 | "end": "2017-01-01T09:00:00.000+08:00",
137 | "link": "http://example2.com"
138 | }
139 | ],
140 | "count": 2,
141 | "page": 1
142 | }
143 | ```
144 |
--------------------------------------------------------------------------------
/course-service/v1/course/course.md:
--------------------------------------------------------------------------------
1 | # Find Course Information
2 |
3 | ```
4 | GET /courses/{serialNo}
5 | ```
6 |
7 | ## Description
8 | > Find course information by its id.
9 |
10 | # Request
11 | ## Headers
12 |
13 |
14 | Name |
15 | Required |
16 | Description |
17 |
18 |
19 | X-NCU-API-TOKEN |
20 | yes |
21 | Your API token |
22 |
23 |
24 |
25 | ## Example
26 | ```
27 | GET /courses/12034
28 | ```
29 |
30 | # Response
31 |
32 | ## Formats
33 | - json
34 |
35 | ## Structure
36 |
37 |
38 | Field Name |
39 | Type |
40 | Value Description |
41 |
42 |
43 | serialNo |
44 | String |
45 | course id, 5 digits and left padding 0. |
46 |
47 |
48 | no |
49 | String |
50 | course number |
51 |
52 |
53 | classNo |
54 | String |
55 | class number, * means not specify. |
56 |
57 |
58 | name |
59 | String |
60 | course name |
61 |
62 |
63 | isClosed |
64 | Boolean |
65 | is canceled or not. |
66 |
67 |
68 | memo |
69 | String |
70 | memo |
71 |
72 |
73 | isMasterDoctor |
74 | Boolean |
75 | is both for master and doctor. |
76 |
77 |
78 | language |
79 | Enum |
80 | language that instructor(s) use.
81 |
82 |
83 | Chinese |
84 | 中文 |
85 |
86 |
87 | English |
88 | 英語 |
89 |
90 |
91 | French |
92 | 法語 |
93 |
94 |
95 | Taiwanese |
96 | 台語 |
97 |
98 |
99 | Hakka |
100 | 客語 |
101 |
102 |
103 | Japanese |
104 | 日本語 |
105 |
106 |
107 | Spanish |
108 | 西班牙語 |
109 |
110 |
111 | German |
112 | 德語 |
113 |
114 |
115 | Partially English |
116 | 部份英語 |
117 |
118 |
119 | |
120 |
121 |
122 | passwordCard |
123 | Enum |
124 |
125 | Password Card
126 |
127 |
128 | no |
129 | 不使用 |
130 |
131 |
132 | optional |
133 | 部份使用 |
134 |
135 |
136 | all |
137 | 全部使用 |
138 |
139 |
140 | |
141 |
142 |
143 | isFirstRun |
144 | Boolean |
145 | is available at first selection. |
146 |
147 |
148 | isPreSelect |
149 | Boolean |
150 | will be selected for student before first selection. |
151 |
152 |
153 | teachers |
154 | String Array |
155 | teacher names |
156 |
157 |
158 | credit |
159 | Number |
160 | credit |
161 |
162 |
163 | classRooms |
164 | String[] |
165 | class room number with building code |
166 |
167 |
168 | times |
169 | Object |
170 | Key : Day of Week
171 |
172 |
173 | 0 |
174 | Monday |
175 |
176 |
177 | 1 |
178 | Tuesday |
179 |
180 |
181 | 2 |
182 | Wednesday |
183 |
184 |
185 | 3 |
186 | Thursday |
187 |
188 |
189 | 4 |
190 | Friday |
191 |
192 |
193 | 5 |
194 | Saturday |
195 |
196 |
197 | 6 |
198 | Sunday |
199 |
200 |
201 | Value : array of period(s)
202 |
203 |
204 | sequences |
205 | 1,2,3,4,Z,5,6,7,8,9,A,B,C,D,E,F |
206 |
207 |
208 | |
209 |
210 |
211 | type |
212 | Enum |
213 |
214 |
215 |
216 | required |
217 | 必修 |
218 |
219 |
220 | elective |
221 | 選修 |
222 |
223 |
224 | |
225 |
226 |
227 | fullHalf |
228 | Enum |
229 | half year(1 semester) or full year(2 semesters)
230 |
231 |
232 | full |
233 | 全 |
234 |
235 |
236 | half |
237 | 半 |
238 |
239 |
240 | |
241 |
242 |
243 | maxStudents |
244 | Number |
245 | maximum amount of students, 0 means infinity. |
246 |
247 |
248 |
249 | ## Example
250 | ```json
251 | [
252 | {
253 | "serialNo" : 12034,
254 | "no" : "EL5001",
255 | "classNo" : "*",
256 | "name" : "文學/文化理論導讀",
257 | "isClosed" : false,
258 | "memo": "限三、四年級",
259 | "isMasterDoctor": false,
260 | "language": "國語",
261 | "passwordCard": "不使用",
262 | "isFirstRun": true,
263 | "isPreSelect": true,
264 | "teachers": [ "錢夫人", "阿土伯" ],
265 | "credit": 2,
266 | "classRooms": [ "C2-209", "C2-209" ],
267 | "times": {
268 | "0": ["5"],
269 | "2": ["3", "4"]
270 | },
271 | "type": "必修",
272 | "fullHalf": "全",
273 | "maxStudents": 0
274 | }
275 | ]
276 | ```
--------------------------------------------------------------------------------
/course-service/v1/course/limit.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NCU-CC/API-Documentation/29405a7faa1ef71909ea4f78a2ed62ec596d6770/course-service/v1/course/limit.md
--------------------------------------------------------------------------------
/course-service/v1/course/search.md:
--------------------------------------------------------------------------------
1 | # Search Course Information
2 |
3 | ```
4 | GET /courses
5 | ```
6 |
7 | ## Description
8 | > Search course information at current semester.
9 |
10 | # Request
11 | ## Headers
12 |
13 |
14 | Name |
15 | Required |
16 | Description |
17 |
18 |
19 | X-NCU-API-TOKEN |
20 | yes |
21 | Your API token |
22 |
23 |
24 |
25 | ## Query Parameter
26 |
27 |
28 | Name |
29 | Required |
30 | Description |
31 |
32 |
33 | dept |
34 | no |
35 | department id |
36 |
37 |
38 | week |
39 | no |
40 |
41 |
42 |
43 | 0 |
44 | Monday |
45 |
46 |
47 | 1 |
48 | Tuesday |
49 |
50 |
51 | 2 |
52 | Wednesday |
53 |
54 |
55 | 3 |
56 | Thursday |
57 |
58 |
59 | 4 |
60 | Friday |
61 |
62 |
63 | 5 |
64 | Saturday |
65 |
66 |
67 | 6 |
68 | Sunday |
69 |
70 |
71 | |
72 |
73 |
74 | period |
75 | no |
76 | 1,2,3,4,Z,5,6,7,8,9,A,B,C,D,E,F |
77 |
78 |
79 | limit |
80 | no |
81 | 1 <= limit <= 500, defaults to 30. |
82 |
83 |
84 | keyword |
85 | no |
86 | at most 3 |
87 |
88 |
89 |
90 | ## Example
91 | ```
92 | GET /courses?period=2&week=3
93 | ```
94 |
95 | # Response
96 |
97 | ## Formats
98 | - json
99 |
100 | ## Structure
101 |
102 |
103 | Field Name |
104 | Type |
105 | Value Description |
106 |
107 |
108 | result |
109 | list |
110 | [Course Object] |
111 |
112 |
113 |
114 | ## Example
115 | - [Course Example](../course/course.md#example-1)
116 |
117 | ## Notes
118 | - [Course Object](../course/course.md#structure)
--------------------------------------------------------------------------------
/course-service/v1/search/departments_courses.md:
--------------------------------------------------------------------------------
1 | # Search Course Information By Department
2 |
3 | ```
4 | GET /departments/{departmentId}/courses
5 | ```
6 |
7 | ## Description
8 | > Search course information by department.
9 |
10 | # Request
11 | ## Headers
12 |
13 |
14 | Name |
15 | Required |
16 | Description |
17 |
18 |
19 | X-NCU-API-TOKEN |
20 | yes |
21 | Your API token |
22 |
23 |
24 |
25 | ## Example
26 | ```
27 | GET /departments/deptI1I1000I0/courses
28 | ```
29 |
30 | # Response
31 |
32 | ## Formats
33 | - json
34 |
35 | ## Structure
36 |
37 |
38 | Field Name |
39 | Type |
40 | Value Description |
41 |
42 |
43 | result |
44 | list |
45 | [Course Object] |
46 |
47 |
48 |
49 | ## Example
50 | - [Course Example](../course/course.md#example-1)
51 |
52 | ## Notes
53 | - [Course Object](../course/course.md#structure)
--------------------------------------------------------------------------------
/course-service/v1/search/departments_targets.md:
--------------------------------------------------------------------------------
1 | # Find Targets.
2 |
3 | ```
4 | GET /departments/{departmentId}/targets
5 | ```
6 |
7 | ## Description
8 | > Find targets that departments running courses for.
9 |
10 | # Request
11 | ## Headers
12 |
13 |
14 | Name |
15 | Required |
16 | Description |
17 |
18 |
19 | X-NCU-API-TOKEN |
20 | yes |
21 | Your API token |
22 |
23 |
24 |
25 | ## Example
26 | ```
27 | GET /departments/deptI1I1000I0/targets
28 | ```
29 |
30 | # Response
31 |
32 | ## Formats
33 | - json
34 |
35 | ## Structure
36 |
37 |
38 | Field Name |
39 | Type |
40 | Value Description |
41 |
42 |
43 | result |
44 | list |
45 |
46 | Target Object
47 |
48 |
49 | name |
50 | String |
51 | target name |
52 |
53 |
54 | id |
55 | String |
56 | target Id |
57 |
58 |
59 | |
60 |
61 |
62 |
63 | ## Example
64 | ```json
65 | {
66 | "result" :
67 | [
68 | {
69 | "name" : "中國文學系[不分類]",
70 | "id" : "cofuZdeptI1I1001I0ZcofgI0"
71 | },
72 | {
73 | "name" : "中國文學系[一年級]",
74 | "id" : "cofuZdeptI1I1001I0ZcofgI1"
75 | }
76 | ]
77 | }
78 | ```
--------------------------------------------------------------------------------
/course-service/v1/search/summer.md:
--------------------------------------------------------------------------------
1 | # Search Summer Course Information
2 |
3 | ```
4 | GET /summer/{stage}/courses
5 | ```
6 |
7 | ## Description
8 | > Search course information by summer stage 1 or 2.
9 |
10 | # Request
11 | ## Headers
12 |
13 |
14 | Name |
15 | Required |
16 | Description |
17 |
18 |
19 | X-NCU-API-TOKEN |
20 | yes |
21 | Your API token |
22 |
23 |
24 |
25 | ## Example
26 | ```
27 | GET /summer/1/courses
28 | ```
29 |
30 | # Response
31 |
32 | ## Formats
33 | - json
34 |
35 | ## Structure
36 |
37 |
38 | Field Name |
39 | Type |
40 | Value Description |
41 |
42 |
43 | result |
44 | list |
45 | [Course Object] |
46 |
47 |
48 |
49 | ## Example
50 | - [Course Example](../course/course.md#example-1)
51 |
52 | ## Notes
53 | - [Course Object](../course/course.md#structure)
--------------------------------------------------------------------------------
/course-service/v1/search/target.md:
--------------------------------------------------------------------------------
1 | # Search Course Information By Target
2 |
3 | ```
4 | GET /targets/{targetId}/courses
5 | ```
6 |
7 | ## Description
8 | > Search course information by target.
9 |
10 | # Request
11 | ## Headers
12 |
13 |
14 | Name |
15 | Required |
16 | Description |
17 |
18 |
19 | X-NCU-API-TOKEN |
20 | yes |
21 | Your API token |
22 |
23 |
24 |
25 | ## Example
26 | ```
27 | GET /targets/cofuZdeptI1I1001I0ZcofgI0/courses
28 | ```
29 |
30 | # Response
31 |
32 | ## Formats
33 | - json
34 |
35 | ## Structure
36 |
37 |
38 | Field Name |
39 | Type |
40 | Value Description |
41 |
42 |
43 | result |
44 | list |
45 | [Course Object] |
46 |
47 |
48 |
49 | ## Example
50 | - [Course Example](course/course.md#example)
51 |
52 | ## Notes
53 | - [Course Object](course/course.md#structure)
--------------------------------------------------------------------------------
/course-service/v1/status.md:
--------------------------------------------------------------------------------
1 | # Get Status of Course Selection System
2 |
3 | ```
4 | GET /status
5 | ```
6 |
7 | ## Description
8 | > Get Status of Course Selection System.
9 |
10 | # Request
11 | ## Headers
12 |
13 |
14 | Name |
15 | Required |
16 | Description |
17 |
18 |
19 | X-NCU-API-TOKEN |
20 | yes |
21 | Your API token |
22 |
23 |
24 |
25 | ## Example
26 | ```
27 | GET /status
28 | ```
29 |
30 | # Response
31 |
32 | ## Formats
33 | - json
34 |
35 | ## Structure
36 |
37 |
38 | Field Name |
39 | Type |
40 | Value Description |
41 |
42 |
43 | semester |
44 | String |
45 | 4 digits, 3 for MinGuo year, 1 for semester. |
46 |
47 |
48 | stage |
49 | String |
50 | current course selection stage. |
51 |
52 |
53 |
54 | ## Example
55 | ```json
56 | {
57 | "semester" : 1031,
58 | "stage" : "校際選課"
59 | }
60 | ```
--------------------------------------------------------------------------------
/course-service/v1/student/rejected.md:
--------------------------------------------------------------------------------
1 | # Get Rejected Courses
2 |
3 | ```
4 | GET /student/rejected
5 | ```
6 |
7 | ## Description
8 | > Get student's rejected courses.
9 |
10 | ## Required Scope
11 | - course.schedule.read
12 |
13 | # Request
14 |
15 | ## Headers
16 |
17 |
18 | Name |
19 | Required |
20 | Description |
21 |
22 |
23 | Authorization |
24 | yes |
25 | Your OAuth token in the form of Bearer XXX |
26 |
27 |
28 |
29 | ## Example
30 | ```
31 | GET /student/rejected
32 | ```
33 |
34 | # Response
35 |
36 | ## Formats
37 | - json
38 |
39 | ## Structure
40 | [Course Object](../course/course.md#structure)
41 |
42 | ## Example
43 | [Course Example](../course/course.md#example-1)
--------------------------------------------------------------------------------
/course-service/v1/student/selected.md:
--------------------------------------------------------------------------------
1 | # Get Selected Courses
2 |
3 | ```
4 | GET /student/selected
5 | ```
6 |
7 | ## Description
8 | > Get student's selected courses.
9 |
10 | ## Required Scope
11 | - course.schedule.read
12 |
13 | # Request
14 |
15 | ## Headers
16 |
17 |
18 | Name |
19 | Required |
20 | Description |
21 |
22 |
23 | Authorization |
24 | yes |
25 | Your OAuth token in the form of Bearer XXX |
26 |
27 |
28 |
29 | ## Example
30 | ```
31 | GET /student/selected
32 | ```
33 |
34 | # Response
35 |
36 | ## Formats
37 | - json
38 |
39 | ## Structure
40 | [Course Object](../course/course.md#structure)
41 |
42 | ## Example
43 | [Course Example](../course/course.md#example-1)
--------------------------------------------------------------------------------
/course-service/v1/student/tracking.md:
--------------------------------------------------------------------------------
1 | # Get Tracking Courses
2 |
3 | ```
4 | GET /student/tracking
5 | ```
6 |
7 | ## Description
8 | > Get student's tracking courses.
9 |
10 | ## Required Scope
11 | - course.schedule.read
12 |
13 | # Request
14 |
15 | ## Headers
16 |
17 |
18 | Name |
19 | Required |
20 | Description |
21 |
22 |
23 | Authorization |
24 | yes |
25 | Your OAuth token in the form of Bearer XXX |
26 |
27 |
28 |
29 | ## Example
30 | ```
31 | GET /student/tracking
32 | ```
33 |
34 | # Response
35 |
36 | ## Formats
37 | - json
38 |
39 |
40 | ## Structure
41 | [Course Object](../course/course.md#structure)
42 |
43 | ## Example
44 | [Course Example](../course/course.md#example-1)
--------------------------------------------------------------------------------
/course-service/v1/unit/college.md:
--------------------------------------------------------------------------------
1 | # Find All Colleges.
2 |
3 | ```
4 | GET /colleges
5 | ```
6 |
7 | ## Description
8 | > Find all colleges.
9 |
10 | # Request
11 | ## Headers
12 |
13 |
14 | Name |
15 | Required |
16 | Description |
17 |
18 |
19 | X-NCU-API-TOKEN |
20 | yes |
21 | Your API token |
22 |
23 |
24 |
25 | ## Example
26 | ```
27 | GET /colleges
28 | ```
29 |
30 | # Response
31 |
32 | ## Formats
33 | - json
34 |
35 | ## Structure
36 |
37 |
38 | Field Name |
39 | Type |
40 | Value Description |
41 |
42 |
43 | result |
44 | list |
45 |
46 | College Object
47 |
48 |
49 | name |
50 | String |
51 | college name |
52 |
53 |
54 | id |
55 | String |
56 | college Id |
57 |
58 |
59 | |
60 |
61 |
62 |
63 | ## Example
64 | ```json
65 | {
66 | "result" :
67 | [
68 | {
69 | "name" : "文學院",
70 | "id" : "deptI1I1000I0"
71 | },
72 | {
73 | "name" : "理學院",
74 | "id" : "deptI1I2000I0"
75 | }
76 | ]
77 | }
78 | ```
--------------------------------------------------------------------------------
/course-service/v1/unit/college_department.md:
--------------------------------------------------------------------------------
1 | # Find Departments By College.
2 |
3 | ```
4 | GET /colleges/{collegeId}/departments
5 | ```
6 |
7 | ## Description
8 | > Find departments by college.
9 |
10 | # Request
11 | ## Headers
12 |
13 |
14 | Name |
15 | Required |
16 | Description |
17 |
18 |
19 | X-NCU-API-TOKEN |
20 | yes |
21 | Your API token |
22 |
23 |
24 |
25 | ## Example
26 | ```
27 | GET /colleges/deptI1I1000I0/departments
28 | ```
29 |
30 | # Response
31 |
32 | ## Formats
33 | - json
34 |
35 | ## Structure
36 |
37 |
38 | Field Name |
39 | Type |
40 | Value Description |
41 |
42 |
43 | result |
44 | list |
45 |
46 | Department Object
47 |
48 |
49 | name |
50 | String |
51 | department name |
52 |
53 |
54 | id |
55 | String |
56 | department Id |
57 |
58 |
59 | |
60 |
61 |
62 |
63 | ## Example
64 | ```json
65 | [
66 | {
67 | "name" : "文學院",
68 | "id" : "deptI1I1000I0"
69 | }, {
70 | "name" : "中國文學系",
71 | "id" : "deptI1I1001I0"
72 | }
73 | ]
74 | ```
--------------------------------------------------------------------------------
/location-service/v1/buildings.md:
--------------------------------------------------------------------------------
1 | # Find Buildings
2 |
3 | ```
4 | GET /buildings
5 | ```
6 |
7 | ## Description
8 | > Find buildings of NCU.
9 |
10 | # Request
11 | ## Headers
12 |
13 |
14 | Name |
15 | Required |
16 | Description |
17 |
18 |
19 | X-NCU-API-TOKEN |
20 | yes |
21 | your API token |
22 |
23 |
24 |
25 | ## Example
26 | ```
27 | GET /buildings
28 | ```
29 |
30 | # Response
31 |
32 | ## Formats
33 | - json
34 |
35 | ## Structure
36 |
37 |
38 | Field Name |
39 | Type |
40 | Value Description |
41 |
42 |
43 | chineseName |
44 | String |
45 | building's Chinese name |
46 |
47 |
48 | englishName |
49 | String |
50 | building's English name |
51 |
52 |
53 |
54 | ## Example
55 | ```json
56 | [
57 | {
58 | "chineseName" : "行政大樓",
59 | "englishName" : "Administrative Building",
60 | },
61 | {
62 | "chineseName" : "總圖書館",
63 | "englishName" : "Main Library",
64 | },
65 | ]
66 | ```
--------------------------------------------------------------------------------
/location-service/v1/faculties.md:
--------------------------------------------------------------------------------
1 | # Find Information of Faculties
2 |
3 | ```
4 | GET /faculties
5 | ```
6 |
7 | ## Description
8 | > Find faculty's information by his/her **Chinese** name.
9 |
10 | # Request
11 | ## Headers
12 |
13 |
14 | Name |
15 | Required |
16 | Description |
17 |
18 |
19 | X-NCU-API-TOKEN |
20 | yes |
21 | your API token |
22 |
23 |
24 |
25 | ## Query Parameters
26 |
27 |
28 | Name |
29 | Required |
30 | Description |
31 |
32 |
33 | cname |
34 | yes |
35 | faculty's Chinese name |
36 |
37 |
38 |
39 | ## Example
40 | ```
41 | GET /faculties?cname=王小明
42 | ```
43 |
44 | # Response
45 |
46 | ## Formats
47 | - json
48 |
49 | ## Structure
50 |
51 |
52 | Field Name |
53 | Type |
54 | Value Description |
55 |
56 |
57 | chineseName |
58 | String |
59 | faculty's Chinese name |
60 |
61 |
62 | englishName |
63 | String |
64 | faculty's English name |
65 |
66 |
67 | title |
68 | String |
69 | faculty's title |
70 |
71 |
72 | primaryUnit |
73 | [Unit Object] |
74 | primary unit |
75 |
76 |
77 | secondaryUnit |
78 | [Unit Object] |
79 | secondary unit |
80 |
81 |
82 | officePhone |
83 | Tel |
84 | faculty's office extension |
85 |
86 |
87 |
88 | ## Example
89 | ```json
90 | [
91 | {
92 | "chineseName" : "王小明",
93 | "englishName" : "Wang, Xiao Ming",
94 | "title" : "助理",
95 | "primaryUnit" : {
96 | "unitCode" : "A800",
97 | "chineseName" : "電子計算機中心",
98 | "englishName" : "Computer Center",
99 | "shortName" : "電算中心",
100 | "fullName" : "電子計算機中心",
101 | "url" : "http://www.cc.ncu.edu.tw/introduction/member.php",
102 | "location" : {
103 | "lat" : 24.970128,
104 | "lng" : 121.193719
105 | }
106 | },
107 | "secondaryUnit" : {
108 | "unitCode" : "A830",
109 | "chineseName" : "校務資訊組",
110 | "englishName" : "Campus Information Management Division",
111 | "shortName" : "校務資訊組",
112 | "fullName" : "電子計算機中心-校務資訊組",
113 | "url" : "http://www.cc.ncu.edu.tw/introduction/member.php",
114 | "location" : {
115 | "lat" : 24.970128,
116 | "lng" : 121.193719
117 | }
118 | },
119 | "officePhone" : "99999"
120 | }
121 | ]
122 | ```
123 | ## Notes
124 | - [Unit Object](units.md#structure)
125 |
--------------------------------------------------------------------------------
/location-service/v1/places.md:
--------------------------------------------------------------------------------
1 | # Find Landscapes, Buildings or Faculties.
2 |
3 | ```
4 | GET /places
5 | ```
6 |
7 | ## Description
8 | > Find location of landscapes, buildings or faculties by query parameters.
9 |
10 | # Request
11 | ## Headers
12 |
13 |
14 | Name |
15 | Required |
16 | Description |
17 |
18 |
19 | X-NCU-API-TOKEN |
20 | yes |
21 | your API token |
22 |
23 |
24 | ## Query Parameters
25 |
26 |
27 | Name |
28 | Required |
29 | Description |
30 |
31 |
32 | type |
33 | yes |
34 | place type |
35 |
36 |
37 | cname |
38 | yes |
39 | place's full Chinese name |
40 |
41 |
42 |
43 | **cname** and **type** are exclusive
44 |
45 | ## Place Type
46 |
47 |
48 | type |
49 | description |
50 |
51 |
52 | WHEELCHAIR_RAMP |
53 | 無障礙坡道 |
54 |
55 |
56 | DISABLED_CAR_PARKING |
57 | 無障礙汽車位 |
58 |
59 |
60 | DISABLED_MOTOR_PARKING |
61 | 無障礙機車位 |
62 |
63 |
64 | EMERGENCY |
65 | 緊急 |
66 |
67 |
68 | AED |
69 | AED 自動體外心臟電擊去顫器 |
70 |
71 |
72 | RESTAURANT |
73 | 餐廳 |
74 |
75 |
76 | SPORT_RECREATION |
77 | 休閒生活 |
78 |
79 |
80 | ADMINISTRATION |
81 | 行政服務 |
82 |
83 |
84 | RESEARCH |
85 | 教學研究 |
86 |
87 |
88 | DORMITORY |
89 | 宿舍 |
90 |
91 |
92 | OTHER |
93 | 其他單位 |
94 |
95 |
96 | ATM |
97 | 提款機 |
98 |
99 |
100 | BUS_STATION |
101 | 公車站牌 |
102 |
103 |
104 | PARKING_LOT |
105 | 停車場 |
106 |
107 |
108 |
109 | ## Example
110 |
111 | ```
112 | GET /places?cname=工程五館
113 | ```
114 |
115 | ```
116 | GET /places?type=AED
117 | ```
118 |
119 | # Response
120 |
121 | ## Formats
122 | - json
123 |
124 | ## Structure
125 |
126 |
127 | Field Name |
128 | Type |
129 | Value Description |
130 |
131 |
132 | chineseName |
133 | String |
134 | place's Chinese name |
135 |
136 |
137 | englishName |
138 | String |
139 | place's English name |
140 |
141 |
142 | type |
143 | Enum |
144 | Place Type |
145 |
146 |
147 | location |
148 | LatLng |
149 |
150 |
151 |
152 | lat |
153 | latitude |
154 |
155 |
156 | lng |
157 | longitude |
158 |
159 |
160 | |
161 |
162 |
163 |
164 | ## Example
165 | ```json
166 | [
167 | {
168 | "chineseName" : "AED 自動體外心電擊去顫器",
169 | "englishName" : "AED, Automated External Defibrillator",
170 | "type" : "AED",
171 | "location" : {
172 | "lat" : 24.968275,
173 | "lng" : 121.195092
174 | }
175 | },
176 | {
177 | "chineseName" : "AED 自動體外心電擊去顫器",
178 | "englishName" : "AED, Automated External Defibrillator",
179 | "type" : "AED",
180 | "location" : {
181 | "lat" : 24.966139,
182 | "lng" : 121.19463
183 | }
184 | }
185 | ]
186 | ```
187 |
--------------------------------------------------------------------------------
/location-service/v1/search.md:
--------------------------------------------------------------------------------
1 | # Search By Keywords.
2 |
3 | ```
4 | GET /search
5 | ```
6 |
7 | ## Description
8 | > Search location of landscapes, buildings or faculties by keywords.
9 |
10 | # Request
11 | ## Headers
12 |
13 |
14 | Name |
15 | Required |
16 | Description |
17 |
18 |
19 | X-NCU-API-TOKEN |
20 | yes |
21 | your API token |
22 |
23 |
24 | ## Query parameters
25 |
26 |
27 | Name |
28 | Required |
29 | Description |
30 |
31 |
32 | q |
33 | yes |
34 | keywords |
35 |
36 |
37 | size |
38 | no |
39 | 1 <= size <= 5, defaults to 3. |
40 |
41 |
42 |
43 | ## Example
44 | ```
45 | GET /search?q=志希
46 | ```
47 |
48 | # Response
49 |
50 | ## Formats
51 | - json
52 |
53 | ## Structure
54 |
55 |
56 | Field Name |
57 | Type |
58 | Value Description |
59 |
60 |
61 | chineseName |
62 | String |
63 | place's Chinese name |
64 |
65 |
66 | englishName |
67 | String |
68 | place's English name |
69 |
70 |
71 | type |
72 | Enum |
73 | [Place Type] |
74 |
75 |
76 | location |
77 | LatLng |
78 |
79 | latlng object
80 |
81 |
82 | lat |
83 | Latitude |
84 |
85 |
86 | lng |
87 | Longitude |
88 |
89 |
90 | |
91 |
92 |
93 |
94 | ## Example
95 | ```json
96 | [
97 | {
98 | "chineseName" : "志希館",
99 | "englishName" : "Zhi-Xi Building",
100 | "type" : "ADMINISTRATION",
101 | "location" : {
102 | "lat" : 24.970126,
103 | "lng" : 121.193683
104 | }
105 | }
106 | ]
107 | ```
108 | ## Notes
109 | - [Place Type](places.md#place-type)
110 |
--------------------------------------------------------------------------------
/location-service/v1/units.md:
--------------------------------------------------------------------------------
1 | # Find Administrative and Research Units.
2 |
3 | ```
4 | GET /units
5 | ```
6 |
7 | ## Description
8 | > Find administrative and research units.
9 |
10 | # Request
11 | ## Headers
12 |
13 |
14 | Name |
15 | Required |
16 | Description |
17 |
18 |
19 | X-NCU-API-TOKEN |
20 | yes |
21 | your API token |
22 |
23 |
24 | ## Query Parameters
25 |
26 |
27 | Name |
28 | Required |
29 | Description |
30 |
31 |
32 | fname |
33 | yes |
34 | unit's full Chinese name |
35 |
36 |
37 | building_cname |
38 | yes |
39 | place's full Chinese name |
40 |
41 |
42 |
43 | **fname** and **building_cname** are exclusive
44 |
45 | ## Example
46 |
47 | ```
48 | GET /units?fname=電子計算機中心
49 | ```
50 |
51 | ```
52 | GET /units?building_cname=志希館
53 | ```
54 |
55 | # Response
56 |
57 | ## Formats
58 | - json
59 |
60 | ## Structure
61 |
62 |
63 | Field Name |
64 | Type |
65 | Value Description |
66 |
67 |
68 | unitCode |
69 | String |
70 | unit's code |
71 |
72 |
73 | chineseName |
74 | String |
75 | unit's name Chinese name |
76 |
77 |
78 | englishName |
79 | String |
80 | unit's name English name |
81 |
82 |
83 | shortName |
84 | String |
85 | abbreviation of unit's Chinese name |
86 |
87 |
88 | fullName |
89 | String |
90 | unit's official Chinese name |
91 |
92 |
93 | url |
94 | URL |
95 | unit's website |
96 |
97 |
98 | location |
99 | LatLng |
100 |
101 |
102 |
103 | lat |
104 | latitude |
105 |
106 |
107 | lng |
108 | longitude |
109 |
110 |
111 | |
112 |
113 |
114 |
115 | ## Example
116 | ```json
117 | [
118 | {
119 | "unitCode" : "T400",
120 | "chineseName" : "管理學院",
121 | "englishName" : "College of Management",
122 | "shortName" : "管理學院",
123 | "fullName" : "管理學院",
124 | "url" : "",
125 | "location" : null
126 | },
127 | {
128 | "unitCode" : "A800",
129 | "chineseName" : "電子計算機中心",
130 | "englishName" : "Computer Center",
131 | "shortName" : "電算中心",
132 | "fullName" : "電子計算機中心",
133 | "url" : "http://www.cc.ncu.edu.tw/introduction/member.php",
134 | "location" : {
135 | "lat" : 24.970128,
136 | "lng" : 121.193719
137 | }
138 | }
139 | ]
140 | ```
141 |
--------------------------------------------------------------------------------
/oauth-service/README.md:
--------------------------------------------------------------------------------
1 | # OAuth
2 | We use OAuth2 to **protect personal resources**. Only api service with those resource need oauth access token.
3 | Developers can get access token from 2 ways, they are described below.
4 |
5 | ## Root URL
6 | ```
7 | https://api.cc.ncu.edu.tw/oauth
8 | ```
9 |
10 | ## OAuth Scope
11 | you can view all scopes in [scope list](scope.md)
12 |
13 | ## Authorization Code Grant Flow
14 |
15 | 1. get [authorization code](authorization_code.md)
16 | 2. get [access token](access_token.md) by exchanging with auth code above
17 |
18 | ## Refresh Token Grant Flow
19 |
20 | - get [refresh token](refresh_token.md) by exchanging with refresh token provided from authorization code grant flow
21 |
--------------------------------------------------------------------------------
/oauth-service/access_token.md:
--------------------------------------------------------------------------------
1 | # Access Token
2 |
3 | ```
4 | POST /oauth/token
5 | ```
6 |
7 | ## Description
8 | > exchange access token by authorization code
9 |
10 | # Request
11 | ## Query Parameters
12 |
13 |
14 | Name |
15 | Required |
16 | Description |
17 |
18 |
19 | grant_type |
20 | yes |
21 | it must be authorization_code |
22 |
23 |
24 | code |
25 | yes |
26 | code from authorization code response |
27 |
28 |
29 | client_id |
30 | yes |
31 | your client id |
32 |
33 |
34 | client_secret |
35 | yes |
36 | your client secret |
37 |
38 |
39 |
40 | ## Example
41 | ```
42 | POST /oauth/token?grant_type=authorization_code&code=SplxlOBeZQQYbYS6WxSbIA&client_id=ABC123&client_secret=QQYbY
43 | ```
44 |
45 | # Response
46 |
47 | ## Formats
48 | - json
49 |
50 | ## Structure
51 |
52 |
53 | Field Name |
54 | Type |
55 | Value Description |
56 |
57 |
58 | access_token |
59 | string |
60 | used to access user resource |
61 |
62 |
63 | token_type |
64 | string |
65 | it must be Bearer |
66 |
67 |
68 | expires_in |
69 | number |
70 | expire seconds for access token |
71 |
72 |
73 | refresh_token |
74 | string |
75 | used to get new access token |
76 |
77 |
78 |
79 | ## Example
80 | ```json
81 | {
82 | "access_token" : "2YotnFZFEjr1zCsicMWpAA",
83 | "refresh_token" : "tGzv3JOkF0XG5Qx2TlKWIA",
84 | "token_type" : "Bearer",
85 | "expires_in" : 28800
86 | }
87 | ```
--------------------------------------------------------------------------------
/oauth-service/authorization_code.md:
--------------------------------------------------------------------------------
1 | # Authorization Code
2 |
3 | ```
4 | GET /oauth/authorize
5 | ```
6 |
7 | ## Description
8 | > authorize the client permission request
9 |
10 | # Request
11 | ## Query Parameters
12 |
13 |
14 | Name |
15 | Required |
16 | Description |
17 |
18 |
19 | response_type |
20 | yes |
21 | value must be code |
22 |
23 |
24 | scope |
25 | yes |
26 | required permissions |
27 |
28 |
29 | client_id |
30 | yes |
31 | your client id |
32 |
33 |
34 | state |
35 | no |
36 | check string, you can get same state in response |
37 |
38 |
39 |
40 | ## Example
41 | ```
42 | GET /oauth/authorize?response_type=code&scope=CLASS_READ+CLASS_WRITE&client_id=ABC123
43 | ```
44 |
45 | # Response
46 |
47 | ## Formats
48 | - json
49 |
50 | ## Structure
51 |
52 |
53 | Field Name |
54 | Type |
55 | Value Description |
56 |
57 |
58 | code |
59 | string |
60 | used to exchange access token |
61 |
62 |
63 | state |
64 | string |
65 | present if provided in request |
66 |
67 |
68 |
69 | ## Example
70 |
71 | ```json
72 | {
73 | "code" : "SplxlOBeZQQYbYS6WxSbIA"
74 | }
75 | ```
76 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/oauth-service/refresh_token.md:
--------------------------------------------------------------------------------
1 | # Refresh Token
2 |
3 | ```
4 | POST /oauth/token
5 | ```
6 |
7 | ## Description
8 | > exchange access token by refresh token
9 |
10 | # Request
11 | ## Query Parameters
12 |
13 |
14 | Name |
15 | Required |
16 | Description |
17 |
18 |
19 | grant_type |
20 | yes |
21 | it must be refresh_token |
22 |
23 |
24 | refresh_token |
25 | yes |
26 | code from authorization code response |
27 |
28 |
29 | client_id |
30 | yes |
31 | your client id |
32 |
33 |
34 | client_secret |
35 | yes |
36 | your client secret |
37 |
38 |
39 |
40 | ## Example
41 | ```
42 | GET /oauth/token?grant_type=refresh_token&refresh_token=tGzv3JOkF0XG5Qx2TlKWIA&client_id=ABC123&client_secret=QQYbY
43 | ```
44 |
45 | # Response
46 |
47 | ## Formats
48 | - json
49 |
50 | ## Structure
51 |
52 |
53 | Field Name |
54 | Type |
55 | Value Description |
56 |
57 |
58 | access_token |
59 | string |
60 | used to access user resource |
61 |
62 |
63 | token_type |
64 | string |
65 | it must be Bearer |
66 |
67 |
68 | expires_in |
69 | number |
70 | expire seconds for access token |
71 |
72 |
73 |
74 | ## Example
75 | ```json
76 | {
77 | "access_token" : "2YotnFZFEjr1zCsicMWpAA",
78 | "token_type" : "Bearer",
79 | "expires_in" : 28800
80 | }
81 | ```
--------------------------------------------------------------------------------
/oauth-service/scope.md:
--------------------------------------------------------------------------------
1 | # Oauth Scope
2 |
3 | Value | Description
4 | ----- | -----------
5 | course.schedule.read | read scheduled courses
6 | calendar.event.read | read events in calendar
7 | calendar.event.write | write events to calendar
8 | user.info.basic.read | read user basic information
--------------------------------------------------------------------------------
/personnel-service/v1/cards.md:
--------------------------------------------------------------------------------
1 | # Get Person Information by Card Number
2 |
3 | ```
4 | GET /cards/{card_number}
5 | ```
6 |
7 | ## Description
8 | > Get person information by NCU card number. Read the NCU card number by devices with NFC.
9 |
10 | ## Required Scope
11 | - user.info.basic.read
12 |
13 | # Request
14 |
15 | ## Query Parameters
16 |
17 |
18 | Name |
19 | Required |
20 | Description |
21 |
22 |
23 | id |
24 | yes |
25 | the last 4 digits of your id card number (身分證字號) for security purpose |
26 |
27 |
28 |
29 | ## Headers
30 |
31 |
32 | Name |
33 | Required |
34 | Description |
35 |
36 |
37 | Authorization |
38 | yes |
39 | Your OAuth token in the form of Bearer XXX |
40 |
41 |
42 |
43 | ## Example
44 | ```
45 | GET /cards/F06D4935?id=1234
46 | ```
47 |
48 | ```
49 | GET /cards/F06D2549?id=6789
50 | ```
51 |
52 | # Response
53 |
54 | ## Formats
55 | - json
56 |
57 | ## Structure
58 | There are two types of response. You can verify the type by **type** attribute
59 |
60 | - Student
61 |
62 |
63 |
64 | Field Name |
65 | Type |
66 | Value Description |
67 |
68 |
69 | id |
70 | String |
71 | identity |
72 |
73 |
74 | name |
75 | String |
76 | person name |
77 |
78 |
79 | type |
80 | String |
81 | person type, this must be STUDENT here |
82 |
83 |
84 | unit |
85 | String |
86 | student unit |
87 |
88 |
89 | group |
90 | String |
91 | student group |
92 |
93 |
94 | number |
95 | String |
96 | student number ( deprecated ) |
97 |
98 |
99 |
100 | - Faculty
101 |
102 |
103 |
104 | Field Name |
105 | Type |
106 | Value Description |
107 |
108 |
109 | id |
110 | String |
111 | identity |
112 |
113 |
114 | name |
115 | String |
116 | person name |
117 |
118 |
119 | type |
120 | String |
121 | person type, this must be FACULTY here |
122 |
123 |
124 | unit |
125 | String |
126 | faculty unit |
127 |
128 |
129 | title |
130 | String |
131 | faculty title |
132 |
133 |
134 | number |
135 | String |
136 | faculty number ( deprecated ) |
137 |
138 |
139 |
140 | ## Example
141 | ```json
142 | {
143 | "id": "101502549",
144 | "name" : "john",
145 | "type" : "STUDENT",
146 | "unit" : "computer science",
147 | "group" : "none",
148 | "number" : "101502549",
149 | }
150 | ```
151 |
152 | ```json
153 | {
154 | "id": "F123456",
155 | "name" : "jack",
156 | "type" : "FACULTY",
157 | "unit" : "computer center",
158 | "title" : "software developer",
159 | "number" : "F123456",
160 | }
161 | ```
--------------------------------------------------------------------------------
/personnel-service/v1/info.md:
--------------------------------------------------------------------------------
1 | # Get Person Information
2 |
3 | ```
4 | GET /info
5 | ```
6 |
7 | ## Description
8 | > Get person information from access token
9 |
10 | ## Required Scope
11 | - user.info.basic.read
12 |
13 | # Request
14 |
15 | ## Headers
16 |
17 |
18 | Name |
19 | Required |
20 | Description |
21 |
22 |
23 | Authorization |
24 | yes |
25 | Your OAuth token in the form of Bearer XXX |
26 |
27 |
28 |
29 | ## Example
30 | ```
31 | GET /info
32 | ```
33 |
34 | # Response
35 |
36 | ## Formats
37 | - json
38 |
39 | ## Structure
40 | [Person Object](cards.md#structure)
41 |
42 | ## Example
43 | [Person Example](cards.md#example-1)
--------------------------------------------------------------------------------