a9377a49b8dc547348b956c4997b6feb9c2d6621
.redirects.gollum
... | ... | @@ -0,0 +1,2 @@ |
1 | +--- |
|
2 | +Integration.md: Integration-.md |
Integration-.md
... | ... | @@ -0,0 +1,267 @@ |
1 | +Tools and information for 3rd party integrators |
|
2 | + |
|
3 | + |
|
4 | +## GraphQL |
|
5 | + |
|
6 | +SmartCentral has implemented GraphQL to support an extensible integration method for api access to centre data. |
|
7 | + |
|
8 | +Graphql is currently implemented with persistent token based authentication for fast server to server comms. |
|
9 | + |
|
10 | +Contact us for end points and authentication when you are ready. |
|
11 | + |
|
12 | +### Schema |
|
13 | + |
|
14 | +Schema definition is [here](https://graphqldocs.v.smartcentral.net/). |
|
15 | + |
|
16 | + |
|
17 | +## Examples |
|
18 | + |
|
19 | + |
|
20 | +### Get a list of enrolments |
|
21 | + |
|
22 | +``` |
|
23 | +{ |
|
24 | + "query": "{ |
|
25 | + service(id: 1) { |
|
26 | + id |
|
27 | + enrolments { |
|
28 | + id |
|
29 | + status |
|
30 | + startDate |
|
31 | + } |
|
32 | + } |
|
33 | + }" |
|
34 | +} |
|
35 | +``` |
|
36 | + |
|
37 | +### Get a single enrolment with details |
|
38 | + |
|
39 | +``` |
|
40 | +{ |
|
41 | + "query": "{ |
|
42 | + service(id: 1) { |
|
43 | + id |
|
44 | + enrolments(id: \"sfdev_22020\") { |
|
45 | + id |
|
46 | + status |
|
47 | + startDate |
|
48 | + child { |
|
49 | + dateOfBirth |
|
50 | + contacts { |
|
51 | + firstName |
|
52 | + } |
|
53 | + } |
|
54 | + parent1 { |
|
55 | + firstName |
|
56 | + email |
|
57 | + } |
|
58 | + parent2 { |
|
59 | + lastName |
|
60 | + phone |
|
61 | + } |
|
62 | + } |
|
63 | + } |
|
64 | + }" |
|
65 | +} |
|
66 | +``` |
|
67 | + |
|
68 | +### Who attended on a particular date? (Actual sessions) |
|
69 | + |
|
70 | +``` |
|
71 | +{ |
|
72 | + "query": "{ |
|
73 | + service(id: 472) { |
|
74 | + id |
|
75 | + sessions(date: \"2020-08-06\") { |
|
76 | + room |
|
77 | + enrolmentId |
|
78 | + fee |
|
79 | + startTime |
|
80 | + endTime |
|
81 | + absent |
|
82 | + } |
|
83 | + } |
|
84 | + }" |
|
85 | +} |
|
86 | +``` |
|
87 | + |
|
88 | +### How many children are present at a certain time? |
|
89 | + |
|
90 | + |
|
91 | +``` |
|
92 | +{ |
|
93 | + "query": "{ |
|
94 | + service(id: 472) { |
|
95 | + id |
|
96 | + sessions(date: \"2020-08-06T17:00:01Z\") { |
|
97 | + room |
|
98 | + absent |
|
99 | + } |
|
100 | + } |
|
101 | + }" |
|
102 | +} |
|
103 | +``` |
|
104 | + |
|
105 | +### Who will attend in the future, based on bookings. |
|
106 | + |
|
107 | + |
|
108 | +``` |
|
109 | +{ |
|
110 | + "query": "{ |
|
111 | + service(id: 472) { |
|
112 | + id |
|
113 | + bookedSessions(startDate: \"2021-12-20\", roomId: \"sfsta_762\") { |
|
114 | + enrolmentId |
|
115 | + room |
|
116 | + roomId |
|
117 | + code |
|
118 | + sessionCodeId |
|
119 | + fee |
|
120 | + startTime |
|
121 | + endTime |
|
122 | + absent |
|
123 | + } |
|
124 | + } |
|
125 | + }" |
|
126 | +} |
|
127 | +``` |
|
128 | + |
|
129 | +### Query Application Forms. |
|
130 | + |
|
131 | +The SEPD team has released the change to allow query application forms. |
|
132 | + |
|
133 | +The schema definition: |
|
134 | + |
|
135 | +https://graphqldocs.v.smartcentral.net/object/service#applications |
|
136 | + |
|
137 | +https://graphqldocs.v.smartcentral.net/object/app/ |
|
138 | + |
|
139 | + |
|
140 | +It has one param status. Possible values are: |
|
141 | + |
|
142 | +incomplete, submitted, waitlisted, information_requested, withdrawn, approved |
|
143 | + |
|
144 | +Sample request |
|
145 | + |
|
146 | +``` |
|
147 | +{ |
|
148 | + "query": "{ |
|
149 | + service(id: 979) { |
|
150 | + applications(status: \"submitted\") { |
|
151 | + id |
|
152 | + plannedStartDate |
|
153 | + plannedDays |
|
154 | + childFirstName |
|
155 | + parentLastName |
|
156 | + childDob |
|
157 | + } |
|
158 | + } |
|
159 | + }" |
|
160 | +} |
|
161 | +``` |
|
162 | + |
|
163 | +### List of applications (TEST) |
|
164 | + |
|
165 | +The type of application |
|
166 | +https://brave-sack.surge.sh/object/app/ |
|
167 | + |
|
168 | +``` |
|
169 | +{ |
|
170 | + "query": "{ |
|
171 | + service(id: 1) { |
|
172 | + applications(status: \"submitted\") { |
|
173 | + id |
|
174 | + plannedStartDate |
|
175 | + plannedDays |
|
176 | + childFirstName |
|
177 | + parentLastName |
|
178 | + childDob |
|
179 | + } |
|
180 | + } |
|
181 | + }" |
|
182 | +} |
|
183 | +``` |
|
184 | + |
|
185 | +### List of staff sign in and out (TEST) |
|
186 | + |
|
187 | +https://brave-sack.surge.sh/object/staffatt/ |
|
188 | + |
|
189 | +``` |
|
190 | +{ |
|
191 | + "query": "{ |
|
192 | + service(id: 976) { |
|
193 | + staffAtts(date: \"2019-05-15\") { |
|
194 | + in |
|
195 | + out |
|
196 | + date |
|
197 | + firstName |
|
198 | + roomName |
|
199 | + unpaid |
|
200 | + } |
|
201 | + } |
|
202 | + }" |
|
203 | +} |
|
204 | +``` |
|
205 | + |
|
206 | +# Authentication |
|
207 | + |
|
208 | +## Fixed Token |
|
209 | + |
|
210 | +A fixed token will be assigned to the integration partner for server to server integration. |
|
211 | + |
|
212 | +## OpenID Connect |
|
213 | + |
|
214 | + |
|
215 | +SmartCentral supports the OpenID Connect specification as an Identity Provider. |
|
216 | + |
|
217 | +Resources for specifications and sample code libraries: |
|
218 | + |
|
219 | +* [[http://openid.net/connect/]] |
|
220 | + |
|
221 | +* [[https://github.com/IdentityModel/IdentityModel.OidcClient]] |
|
222 | + |
|
223 | +FAQ |
|
224 | + |
|
225 | +* [[http://openid.net/connect/faq/]] |
|
226 | + |
|
227 | + |
|
228 | +Our OpenID entry point for staging is: |
|
229 | + |
|
230 | +* [[http://test.smartcentral.net/authorizations/new/]] |
|
231 | + |
|
232 | +To get JWK public keys : |
|
233 | + |
|
234 | +* [[http://test.smartcentral.net/jwks.json]] |
|
235 | + |
|
236 | +Create your own test account : |
|
237 | + |
|
238 | +* [[http://test.smartcentral.net/user/new/]] |
|
239 | + |
|
240 | + |
|
241 | +### Implicit flow |
|
242 | + |
|
243 | +* 3rd party sends authorisation request |
|
244 | + |
|
245 | +http://test.smartcentral.net/authorizations/new/?client_id=fancy_app&response_type=id_token%20token&scope=openid%20email&nonce=1234&redirect_uri=http://localhost:3001/auth |
|
246 | + |
|
247 | +* SmartCentral redirects end user to login page if not logged in, after end user's authorisation, send the following fields (http form fields encoded) to redirect_uri provided by 3rd party. |
|
248 | + |
|
249 | + * access_token |
|
250 | + * id_tokenhttps://wiki.smartcentral.net/livepreview/images/save_24.png |
|
251 | + * token_type |
|
252 | + |
|
253 | +* After 3rd party received id_token (JWT format), the id token should be verified using the public key provided by SmartCentral http://test.smartcentral.net/jwks.json |
|
254 | + |
|
255 | +* To get readble information of the user, 3rd party sends GET request with access token returned by SmartCentral to http://test.smartcentral.net/user_info?access_token=abcd |
|
256 | + |
|
257 | +* User info returns the following fields: |
|
258 | + * subject (SmartCentral user unique id) |
|
259 | + * name |
|
260 | + * email |
|
261 | + |
|
262 | +### Microsft Active Directory Bridging |
|
263 | + |
|
264 | +The following resources contain information on enabling the use of AD to be an OpenID identity provider: |
|
265 | + |
|
266 | +* https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-protocols-oidc |
|
267 | +* https://docs.microsoft.com/en-us/powerapps/maker/portals/configure/configure-openid-settings |
|
... | ... | \ No newline at end of file |
Integration.md
... | ... | @@ -1,267 +0,0 @@ |
1 | -Tools and information for 3rd party integrators |
|
2 | - |
|
3 | - |
|
4 | -## GraphQL |
|
5 | - |
|
6 | -SmartCentral has implemented GraphQL to support an extensible integration method for api access to centre data. |
|
7 | - |
|
8 | -Graphql is currently implemented with persistent token based authentication for fast server to server comms. |
|
9 | - |
|
10 | -Contact us for end points and authentication when you are ready. |
|
11 | - |
|
12 | -### Schema |
|
13 | - |
|
14 | -Schema definition is [here](https://graphqldocs.v.smartcentral.net/). |
|
15 | - |
|
16 | - |
|
17 | -## Examples |
|
18 | - |
|
19 | - |
|
20 | -### Get a list of enrolments |
|
21 | - |
|
22 | -``` |
|
23 | -{ |
|
24 | - "query": "{ |
|
25 | - service(id: 1) { |
|
26 | - id |
|
27 | - enrolments { |
|
28 | - id |
|
29 | - status |
|
30 | - startDate |
|
31 | - } |
|
32 | - } |
|
33 | - }" |
|
34 | -} |
|
35 | -``` |
|
36 | - |
|
37 | -### Get a single enrolment with details |
|
38 | - |
|
39 | -``` |
|
40 | -{ |
|
41 | - "query": "{ |
|
42 | - service(id: 1) { |
|
43 | - id |
|
44 | - enrolments(id: \"sfdev_22020\") { |
|
45 | - id |
|
46 | - status |
|
47 | - startDate |
|
48 | - child { |
|
49 | - dateOfBirth |
|
50 | - contacts { |
|
51 | - firstName |
|
52 | - } |
|
53 | - } |
|
54 | - parent1 { |
|
55 | - firstName |
|
56 | - email |
|
57 | - } |
|
58 | - parent2 { |
|
59 | - lastName |
|
60 | - phone |
|
61 | - } |
|
62 | - } |
|
63 | - } |
|
64 | - }" |
|
65 | -} |
|
66 | -``` |
|
67 | - |
|
68 | -### Who attended on a particular date? (Actual sessions) |
|
69 | - |
|
70 | -``` |
|
71 | -{ |
|
72 | - "query": "{ |
|
73 | - service(id: 472) { |
|
74 | - id |
|
75 | - sessions(date: \"2020-08-06\") { |
|
76 | - room |
|
77 | - enrolmentId |
|
78 | - fee |
|
79 | - startTime |
|
80 | - endTime |
|
81 | - absent |
|
82 | - } |
|
83 | - } |
|
84 | - }" |
|
85 | -} |
|
86 | -``` |
|
87 | - |
|
88 | -### How many children are present at a certain time? |
|
89 | - |
|
90 | - |
|
91 | -``` |
|
92 | -{ |
|
93 | - "query": "{ |
|
94 | - service(id: 472) { |
|
95 | - id |
|
96 | - sessions(date: \"2020-08-06T17:00:01Z\") { |
|
97 | - room |
|
98 | - absent |
|
99 | - } |
|
100 | - } |
|
101 | - }" |
|
102 | -} |
|
103 | -``` |
|
104 | - |
|
105 | -### Who will attend in the future, based on bookings. |
|
106 | - |
|
107 | - |
|
108 | -``` |
|
109 | -{ |
|
110 | - "query": "{ |
|
111 | - service(id: 472) { |
|
112 | - id |
|
113 | - bookedSessions(startDate: \"2021-12-20\", roomId: \"sfsta_762\") { |
|
114 | - enrolmentId |
|
115 | - room |
|
116 | - roomId |
|
117 | - code |
|
118 | - sessionCodeId |
|
119 | - fee |
|
120 | - startTime |
|
121 | - endTime |
|
122 | - absent |
|
123 | - } |
|
124 | - } |
|
125 | - }" |
|
126 | -} |
|
127 | -``` |
|
128 | - |
|
129 | -### Query Application Forms. |
|
130 | - |
|
131 | -The SEPD team has released the change to allow query application forms. |
|
132 | - |
|
133 | -The schema definition: |
|
134 | - |
|
135 | -https://graphqldocs.v.smartcentral.net/object/service#applications |
|
136 | - |
|
137 | -https://graphqldocs.v.smartcentral.net/object/app/ |
|
138 | - |
|
139 | - |
|
140 | -It has one param status. Possible values are: |
|
141 | - |
|
142 | -incomplete, submitted, waitlisted, information_requested, withdrawn, approved |
|
143 | - |
|
144 | -Sample request |
|
145 | - |
|
146 | -``` |
|
147 | -{ |
|
148 | - "query": "{ |
|
149 | - service(id: 979) { |
|
150 | - applications(status: \"submitted\") { |
|
151 | - id |
|
152 | - plannedStartDate |
|
153 | - plannedDays |
|
154 | - childFirstName |
|
155 | - parentLastName |
|
156 | - childDob |
|
157 | - } |
|
158 | - } |
|
159 | - }" |
|
160 | -} |
|
161 | -``` |
|
162 | - |
|
163 | -### List of applications (TEST) |
|
164 | - |
|
165 | -The type of application |
|
166 | -https://brave-sack.surge.sh/object/app/ |
|
167 | - |
|
168 | -``` |
|
169 | -{ |
|
170 | - "query": "{ |
|
171 | - service(id: 1) { |
|
172 | - applications(status: \"submitted\") { |
|
173 | - id |
|
174 | - plannedStartDate |
|
175 | - plannedDays |
|
176 | - childFirstName |
|
177 | - parentLastName |
|
178 | - childDob |
|
179 | - } |
|
180 | - } |
|
181 | - }" |
|
182 | -} |
|
183 | -``` |
|
184 | - |
|
185 | -### List of staff sign in and out (TEST) |
|
186 | - |
|
187 | -https://brave-sack.surge.sh/object/staffatt/ |
|
188 | - |
|
189 | -``` |
|
190 | -{ |
|
191 | - "query": "{ |
|
192 | - service(id: 976) { |
|
193 | - staffAtts(date: \"2019-05-15\") { |
|
194 | - in |
|
195 | - out |
|
196 | - date |
|
197 | - firstName |
|
198 | - roomName |
|
199 | - unpaid |
|
200 | - } |
|
201 | - } |
|
202 | - }" |
|
203 | -} |
|
204 | -``` |
|
205 | - |
|
206 | -# Authentication |
|
207 | - |
|
208 | -## Fixed Token |
|
209 | - |
|
210 | -A fixed token will be assigned to the integration partner for server to server integration. |
|
211 | - |
|
212 | -## OpenID Connect |
|
213 | - |
|
214 | - |
|
215 | -SmartCentral supports the OpenID Connect specification as an Identity Provider. |
|
216 | - |
|
217 | -Resources for specifications and sample code libraries: |
|
218 | - |
|
219 | -* [[http://openid.net/connect/]] |
|
220 | - |
|
221 | -* [[https://github.com/IdentityModel/IdentityModel.OidcClient]] |
|
222 | - |
|
223 | -FAQ |
|
224 | - |
|
225 | -* [[http://openid.net/connect/faq/]] |
|
226 | - |
|
227 | - |
|
228 | -Our OpenID entry point for staging is: |
|
229 | - |
|
230 | -* [[http://test.smartcentral.net/authorizations/new/]] |
|
231 | - |
|
232 | -To get JWK public keys : |
|
233 | - |
|
234 | -* [[http://test.smartcentral.net/jwks.json]] |
|
235 | - |
|
236 | -Create your own test account : |
|
237 | - |
|
238 | -* [[http://test.smartcentral.net/user/new/]] |
|
239 | - |
|
240 | - |
|
241 | -### Implicit flow |
|
242 | - |
|
243 | -* 3rd party sends authorisation request |
|
244 | - |
|
245 | -http://test.smartcentral.net/authorizations/new/?client_id=fancy_app&response_type=id_token%20token&scope=openid%20email&nonce=1234&redirect_uri=http://localhost:3001/auth |
|
246 | - |
|
247 | -* SmartCentral redirects end user to login page if not logged in, after end user's authorisation, send the following fields (http form fields encoded) to redirect_uri provided by 3rd party. |
|
248 | - |
|
249 | - * access_token |
|
250 | - * id_tokenhttps://wiki.smartcentral.net/livepreview/images/save_24.png |
|
251 | - * token_type |
|
252 | - |
|
253 | -* After 3rd party received id_token (JWT format), the id token should be verified using the public key provided by SmartCentral http://test.smartcentral.net/jwks.json |
|
254 | - |
|
255 | -* To get readble information of the user, 3rd party sends GET request with access token returned by SmartCentral to http://test.smartcentral.net/user_info?access_token=abcd |
|
256 | - |
|
257 | -* User info returns the following fields: |
|
258 | - * subject (SmartCentral user unique id) |
|
259 | - * name |
|
260 | - * email |
|
261 | - |
|
262 | -### Microsft Active Directory Bridging |
|
263 | - |
|
264 | -The following resources contain information on enabling the use of AD to be an OpenID identity provider: |
|
265 | - |
|
266 | -* https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-protocols-oidc |
|
267 | -* https://docs.microsoft.com/en-us/powerapps/maker/portals/configure/configure-openid-settings |
|
... | ... | \ No newline at end of file |