-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tex
1410 lines (1303 loc) · 54.4 KB
/
main.tex
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
\documentclass[a4paper]{scrreprt}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{vhistory, hyperref, listings, fullpage, enumitem, xcolor, bera}
\setlist[enumerate]{format=\bfseries\itshape, leftmargin=3em}
\setlist[enumerate,2]{leftmargin=4em}
\setlist[enumerate,1]{format=\bfseries,leftmargin=2em}
\interlinepenalty 10000
\colorlet{punct}{red!60!black}
\definecolor{background}{HTML}{F8F8F8}
\definecolor{delim}{RGB}{20,105,176}
\colorlet{numb}{magenta!60!black}
\lstdefinelanguage{json}{
basicstyle=\normalfont\ttfamily,
numbersep=8pt,
showstringspaces=false,
breaklines=true,
frame=lines,
framesep=0pt,
framextopmargin=4pt,
framexbottommargin=4pt,
backgroundcolor=\color{background},
literate=
*{0}{{{\color{numb}0}}}{1}
{1}{{{\color{numb}1}}}{1}
{2}{{{\color{numb}2}}}{1}
{3}{{{\color{numb}3}}}{1}
{4}{{{\color{numb}4}}}{1}
{5}{{{\color{numb}5}}}{1}
{6}{{{\color{numb}6}}}{1}
{7}{{{\color{numb}7}}}{1}
{8}{{{\color{numb}8}}}{1}
{9}{{{\color{numb}9}}}{1}
{:}{{{\color{punct}{:}}}}{1}
{,}{{{\color{punct}{,}}}}{1}
{\{}{{{\color{delim}{\{}}}}{1}
{\}}{{{\color{delim}{\}}}}}{1}
{[}{{{\color{delim}{[}}}}{1}
{]}{{{\color{delim}{]}}}}{1},
}
\lstset{
language=json
}
\title{Amelie JSON-RPC API Specification}
\author{I.C.T.S.V. Inter-\emph{Actief}}
\date{\today}
\begin{document}
\maketitle
\begin{versionhistory}
\vhEntry{0.1}{2014/07/13}{vollenbrockjhj}{basic structure, auth module, news module}
\vhEntry{0.2}{2014/07/14}{vollenbrockjhj}{news, narrowcast, and committee module}
\vhEntry{0.3}{2014/07/14}{vollenbrockjhj}{company module and activity module}
\vhEntry{0.4}{2014/07/15}{vollenbrockjhj}{typography, layout, document style}
\vhEntry{0.5}{2016/11/20}{albertskja}{added Narrowcast.getHistoricActivitiesWithPictures and added optional
parameter to getNews}
\vhEntry{0.6}{2016/11/30}{boerpb}{property naming convention, restaurant and dish activity option properties}
\vhEntry{0.7}{2016/11/30}{boerpb}{added listing of additional return properties of getActivityStream}
\vhEntry{0.8}{2016/12/14}{boerpb}{authentication and preview mode descriptions revised}
\vhEntry{0.9}{2016/12/14}{boerpb}{person and push module}
\vhEntry{1.0}{2016/12/17}{boerpb}{education module, transaction module, naming consistency in company module, localization, authentication scopes}
\vhEntry{1.1}{2017/01/09}{boerpb}{markdown support for getNewsDetailed, OAuth implementation documentation}
\vhEntry{1.2}{2017/03/07}{boerpb}{added setLanguagePreference to person, reworked activities, moved getDeviceId to push, added deprecation warning to getAuthToken}
\vhEntry{1.3}{2021/11/15}{meulenkampt}{added a link to the Inter-\textit{Actief} website where a client and secret key can be requested for API access}
\end{versionhistory}
\tableofcontents
\chapter{Introduction}
This document describes the jsonrpc application programming interface of amelie, the administration system of I.C.T.S.V. Inter-/Actief/. It should guide you through the different exposed entities and provide basic pointers to help you to enable your application to consume this data from amelie.\\
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
\section{Request Access}
Before one can access this API they will have to request the needed access tokens. This can be done on the Inter-\textit{Actief} webpage with the following URL: \url{https://ia.utwente.nl/social_auth/request_access/}
\section{Endpoints}
The current version of the API (codename lennart) can be reached in both production and staging environments. The sandboxed staging environment has been created to ensure production data integrity.
\subsection{Production Environment}
To access the API in the production environment, the following endpoint has to be used:
\begin{lstlisting}
https://www.inter-actief.utwente.nl/api/
\end{lstlisting}
Please note that the trailing slash is required.
\subsection{Staging Environment}
To access the API in the staging environment, the following endpoint has to be used:
\begin{lstlisting}
https://staging.inter-actief.utwente.nl/api/
\end{lstlisting}
Please note that the trailing slash is required.
\section{Localization}
As of this version of the API, two languages are supported: Dutch and English. Most data can be translated to either one of these languages, if requested properly.\\
In order to receive localized responses, the Accept-Language HTTP header should be set in accordance with RFC5646, for example:
\begin{lstlisting}
Accept-Language: nl-NL
\end{lstlisting}
\clearpage
\section{JSON-RPC Request}
In order to execute a remote procedure, you must send an HTTP POST request, containing a json dictionary in compliance to the JSON-RPC 2.0 specification\cite{jsonrpc}. This implies that each request dictionary must at least contain the following keys:
\begin{enumerate}
\item[jsonrpc] A String specifying the version of the JSON-RPC protocol. This field MUST be exactly "2.0" in order to use JSON-RPC 2.0 features. When omitted JSON-RPC 1.0 is assumed.
\item[method]
A String containing the name of the method to be invoked.
\item[params]
A Structured value that holds the parameter values to be used during the invocation of the method. If a method does not require any parameters, an empty array MUST be included.
\item[id]
An identifier established by the Client that MUST contain a String or Number. Numbers SHOULD NOT contain fractional parts.
\end{enumerate}
The `id' and `jsonrpc' fields are ommitted in all examples.
\section{JSON-RPC Response}
After sending a request, a response object will be returned. The response object consists of a json dictionary containing the following keys:
\begin{enumerate}
\item[jsonrpc]
A String specifying the version of the JSON-RPC protocol.
\item[result]
The value of this member is determined by the method invoked on the Server.
\item[error]
This member only exists if an error has occured. The structure of this member is defined in \autoref{sec:errordict}. If no error has occured, this member MAY also be null.
\item[id]
This member contains the value of the id member in the Request Object. If the id could not be parsed due to a parse error, it will be set to null.
\end{enumerate}
The `id' and `jsonrpc' fields are ommitted in all examples.
\clearpage
\section{Device ID}
Some methods may require a deviceId. A deviceId is an unique token, used to identify your device or service. Obtaining a new deviceId can be done through the getDeviceId method as described in \autoref{m:getDeviceId}.
\section{Authentication \& Authorization}
Some methods MAY or MUST be invoked using authentication. In order to make an authenticated call, your application MUST first request an authentication token. This can be done using the getAuthToken method. More information can be found in \autoref{m:getAuthToken}.\\\\
When used, an authentication token MUST be included in the HTTP Authorization header in the following fashion:
\begin{lstlisting}
Bearer some.long.auth.token!%&...
\end{lstlisting}
\subsection{Scopes}
After using the getAuthToken method, which can be found in \autoref{m:getAuthToken}, the token returned will automatically be assigned all available scopes.\\
The following scopes currently exist within the API:
\begin{enumerate}
\item[account] This scope is required to get access to personal data, such as name and student number.
\item[signup] This scope is required to (de-)register for activities.
\item[transaction] This scope is required for transactions, mandates, RFID-cards and direct debits.
\item[education] This scope allows for the creation and reading of educational complaints.
\end{enumerate}
OAuth applications will have to request each of these scopes individually. More information about OAuth can be found in \autoref{subsec:oauth}.
\subsection{OAuth}\label{subsec:oauth}
In order to use OAuth with the Inter-Actief API in your application, you will first need to register an OAuth application to obtain a client\_id. This can be done by sending an email describing your request to \href{mailto:[email protected]}{[email protected]}. Make sure to mention your application name and redirect uri(s). More information might be requested if required.\\\\
When you have obtained your client\_id, you will need to use the following endpoint to receive your token:
\begin{lstlisting}
https://www.inter-actief.utwente.nl/o/authorize/?client_id={client_id}
&scope={scopes}&response_type=token
\end{lstlisting}
Replace \{client\_id\} with your client\_id and \{scopes\} with one or more scopes separated by the '+' character.
\clearpage
\chapter{Methods}
The API exposes different methods. These methods are all grouped into modules. A module contains the methods involving a specific entity of amelie.
\section{Authentication Module}\label{sec:authmodule}
\subsection{getAuthToken*}\label{m:getAuthToken}
*This method will be phased out as soon as possible. You SHOULD NOT use this method. Instead, it is RECOMMENDED to use OAuth2 to authenticate with the Inter-Actief API.
\begin{enumerate}
\item[Method] getAuthToken
\item[Description] Attempts to log in and returns an authentication token.
\item[Authentication] (none)
\item[Parameters] This method accepts the following parameters:
\begin{enumerate}
\item[username] The username of the user
\item[password] The password of the user
\item[deviceId] The device ID obtained through getDeviceId.
\end{enumerate}
\item[Returns] A string containing the auth token, or null if the authentication failed.
\item[Errors] UnknownDeviceError: when the device ID was not recognized.
\item[Example]
\begin{lstlisting}
--> {"method":"getAuthToken", "params":["user","pass","deviceId"]}
<-- {"result": "some.long.auth.token!%&..."}
\end{lstlisting}
\end{enumerate}
\clearpage
\subsection{checkAuthToken}
\begin{enumerate}
\item[Method] checkAuthToken
\item[Description] Checks if an auth token is still valid. It is recommended to do this after resuming your app, to see if the token was revoked.
\item[Authentication] (none)
\item[Parameters] (none)
\item[Returns] true if the token was valid and an user is attached, false otherwise.
\item[Errors] (none)
\item[Example]
\begin{lstlisting}
--> {"method":"checkAuthToken", "params":[]}
<-- {"result": true}
\end{lstlisting}
\end{enumerate}
\subsection{revokeAuthToken}
\begin{enumerate}
\item[Method] revokeAuthToken
\item[Description] Revokes an authentication token.
\item[Authentication] (none)
\item[Parameters] (none)
\item[Returns] true if the token was successfully revoked, null otherwise.
\item[Errors] NotLoggedInError: If the token was not recognized or already revoked.
\item[Example]
\begin{lstlisting}
--> {"method":"revokeAuthToken", "params":[]}
<-- {"result": true}
\end{lstlisting}
\end{enumerate}
\clearpage
\subsection{getAuthenticatedApps}
\begin{enumerate}
\item[Method] getAuthenticatedApps
\item[Description] Retrieves the list of authenticated apps for the currently authenticated person.
\item[Authentication] REQUIRED (account)
\item[Parameters] (none)
\item[Returns] An array of dictionaries containing the following members:
\begin{enumerate}
\item[applicationId] The identifier of the application
\item[applicationName] The name of the application
\item[expires] The expiration date and time for the token associated with the application (RFC3339)
\item[scopes] The dictionary of permitted scopes for the application, which MAY include any of the following members:
\begin{enumerate}
\item[education] Description of the education authentication scope
\item[transaction] Description of the transaction authentication scope
\item[account] Description of the account authentication scope
\item[signup] Description of the signup authentication scope
\end{enumerate}
\end{enumerate}
\item[Errors] NotLoggedInError: If the token was not recognized or already revoked.
\item[Example]
\begin{lstlisting}
--> {"method":"getAutenticatedApps", "params":[]}
<-- {"result": [{
"applicationId": 1,
"applicationName": "Legacy getAuthToken API token",
"expires": "2016-10-26T00:56:14+00:00",
"scopes": {
"account": "De App krijgt toegang tot je naam, geboortedatum, studentnummer, machtigingstatus en commissiestatus",
"signup": "De App kan je in- en uitschrijven voor activiteiten"
}
}]}
\end{lstlisting}
\end{enumerate}
\clearpage
\section{Person Module}\label{sec:personmodule}
\subsection{getPersonDetails}
\begin{enumerate}
\item[Method] getPersonDetails
\item[Description] Retrieves details of the currently authenticated person.
\item[Authentication] REQUIRED (account)
\item[Parameters] (none)
\item[Returns] A dictionary containing the following members:
\begin{enumerate}
\item[name] The full name of this person
\item[firstName] The first name of this person
\item[lastName] The last name of this person
\item[birthdate] The birthdate of this person
\item[board] true if this person is a board member, false otherwise
\item[candidateBoard] true if this person is a candidate board member, false otherwise
\item[member] true if this person is a member, false otherwise
\item[hasCommittees] true if this member has joined any committees, false otherwise
\item[hasActivityDirectDebit] true if this person has signed a debit contract, false otherwise
\item[username] The username of this person, can be empty or null
\item[studentId] The student ID of this person, can be null
\item[employeeId] The employee ID of this person, can be null
\item[email] The email address of this person
\item[languagePreference] The preferred language for this user, either "nl" or "en"
\item[imageUrl] The profile image URL for the authenticated user
\end{enumerate}
\item[Errors] NotLoggedInError: If the token was not recognized or already revoked.
\item[Example] Please refer to page \pageref{example:getPersonDetails}
\clearpage
\label{example:getPersonDetails}
\begin{lstlisting}
--> {"method":"getPersonDetails", "params":[]}
<-- {"result": {
"name": "Donald D. Duck",
"firstName": "Donald",
"lastName": "Duck",
"birthdate": "1954-02-19",
"board": false
"candidateBoard": false,
"member": true,
"hasCommittees": true,
"hasActivityDirectDebit": true,
"username": "duckdd",
"studentId": "s1234567",
"employeeId": null,
"email": "[email protected]",
"languagePreference": "nl",
"imageUrl": "https://media.ia.utwente.nl/amelie/pasfoto/s1234567.jpg"
}}
\end{lstlisting}
\end{enumerate}
\clearpage
\subsection{setLanguagePreference}
\begin{enumerate}
\item[Method] setLanguagePreference
\item[Description] Sets the language preference for this user across all Inter-Actief services.
\item[Authentication] REQUIRED (account)
\item[Parameters] This method accepts the following parameters:
\begin{enumerate}
\item[language] The preferred language (either "nl" or "en")
\end{enumerate}
\item[Returns] true
\item[Errors] InvalidParamsError
\item[Example]
\begin{lstlisting}
--> {"method":"setLanguagePreference", "params":["en"]}
<-- {"result": true}
\end{lstlisting}
\end{enumerate}
\subsection{getPersonCommittees}
\begin{enumerate}
\item[Method] getPersonCommittees
\item[Description] Retrieves a list of committees in which the currently authenticated person has been a member of, or is currently active in.
\item[Authentication] REQUIRED (account)
\item[Parameters] (none)
\item[Returns] An array of dictionaries containing the following members:
\begin{enumerate}
\item[position] The position of this person in this committee
\item[end] The date on which this person was last member of this committee, otherwise null
\item[begin] The date on which this person first joined this committee
\item[committee] The name of this committee
\end{enumerate}
\item[Errors] NotLoggedInError: If the token was not recognized or already revoked.
\item[Example]
\begin{lstlisting}
--> {"method":"getPersonCommittees", "params":[]}
<-- {"result": [{
"position": "Lead Developer Duckstad",
"end": null,
"begin": "1954-02-19",
"committee": "F.C. Duckstad"
}]}
\end{lstlisting}
\end{enumerate}
\clearpage
\subsection{getPersonMembership}
\begin{enumerate}
\item[Method] getPersonMembership
\item[Description] Retrieves the active membership details of the currently authenticated person
\item[Authentication] REQUIRED (account)
\item[Parameters] (none)
\item[Returns] A dictionaries containing the following members:
\begin{enumerate}
\item[type] The type of membership
\item[year] The year of the active membership
\item[hasEnded] Value indicating whether the membership has ended, either true or false
\item[payment] Details regarding the payment of this membership
\begin{enumerate}
\item[amount] The cost of the active membership
\item[date] Date on which the payment was processed
\item[method] Details regarding the payment method of the active membership
\begin{enumerate}
\item[name] Name of the payment method
\item[description] Description of the payment method
\end{enumerate}
\end{enumerate}
\end{enumerate}
\item[Errors] NotLoggedInError: If the token was not recognized or already revoked.
\item[Example]
\begin{lstlisting}
--> {"method":"getPersonMembership", "params":[]}
<-- {"result": {
"type": "inbitween",
"year": 2016,
"hasEnded": false
"payment": {
"amount": "4.25",
"date": "2016-07-01",
"method": {
"name": "Stress",
"description": "Bij een lidmaatschap van inbitween loopt de betaling via Stress"
}
}
}}
\end{lstlisting}
\end{enumerate}
\clearpage
\section{Push Module}\label{sec:pushmodule}
\subsection{getDeviceId}\label{m:getDeviceId}
\begin{enumerate}
\item[Method] getDeviceId
\item[Description] Requests a new deviceId. Your application SHOULD call this method only once in your apps lifetime, just after its first start, and store the result for further use.
\item[Authentication] (none)
\item[Parameters] (none)
\item[Returns] A string containing a newly assigned deviceId
\item[Errors] (none)
\item[Example]
\begin{lstlisting}
--> {"method":"getDeviceId", "params":[]}
<-- {"result": "QphLtj#z%Itaceny"}
\end{lstlisting}
\end{enumerate}
\subsection{storePushToken}
\begin{enumerate}
\item[Method] storePushToken
\item[Description] Stores a push token (or URI for MPNS).
\item[Authentication] OPTIONAL
\item[Parameters] This method accepts the following parameters:
\begin{enumerate}
\item[deviceId] The deviceId, obtaind with getDeviceId
\item[pushToken] The push token or URI, received from the push supplier
\item[agent] An descriptive string for your device
\item[language] The language code of the device, preferably RFC5646.
\end{enumerate}
\item[Returns] true if the token was successfully stored, otherwise null
\item[Errors] UnknownDeviceError: when the device ID was not recognized.
\item[Example]
\begin{lstlisting}
--> {"method":"storePushToken", "params":["deviceId", "pushToken", "Bob's iPhone @ iOS 8.0", "nl-NL"]}
<-- {"result": true}
<-- {"result": null}
\end{lstlisting}
\end{enumerate}
\clearpage
\section{News Module}
\subsection{getNewsStream}
\begin{enumerate}
\item[Method] getNewsStream
\item[Description] Retrieves a list of recent news items and Twitter messages.
\item[Authentication] (none)
\item[Parameters] This method accepts the following parameters:
\begin{enumerate}
\item[offset] The first item in the list to return
\item[length] The amount of items to return
\end{enumerate}
\item[Returns] An array of dictionaries containing the following members:
\begin{enumerate}
\item[id] The identifier for this news item
\item[title] The title of this item
\item[category] The category of this news item
\item[imageUrl] An URL of a thumbnail for this item
\item[date] The publication date of this item (RFC3339)
\item[source] The source of this item
\item[breakout] true if this item contains its own header, OPTIONAL
\end{enumerate}
\item[Errors] (none)
\item[Example]
\begin{lstlisting}
--> {"method":"getNewsStream", "params":[0,1]}
<-- {"result": [{
"id": 430,
"title": "Read our latest blog post!",
"category": "twitter",
"imageUrl": "https://pbs.twimg.com/profile_image.png",
"date": "2014-07-07T18:56:50+00:00",
"source": "StudyTour",
"breakout": false
}]}
\end{lstlisting}
\end{enumerate}
\clearpage
\subsection{getNewsDetailed}
\begin{enumerate}
\item[Method] getNewsDetailed
\item[Description] Retrieves details of a news item, including its content.
\item[Authentication] (none)
\item[Parameters] This method accepts the following parameters:
\begin{enumerate}
\item[source] The source of the requested item
\item[id] The id of the requested item
\item[render\_markdown] A boolean that indicates whether you want to render markdown in the introduction and content to HTML, OPTIONAL, default false.
\end{enumerate}
\item[Returns] A Dictionary containing the following fields:
\begin{enumerate}
\item[id] The identifier for this news item
\item[title] The title of this item
\item[category] The category of this news item
\item[imageUrl] An URL of a thumbnail for this item
\item[date] The publication date of this item (RFC3339)
\item[source] The source of this item
\item[breakout] true if this item contains its own header, OPTIONAL
\item[author] the Author of this news item
\item[introduction] The introduction of this news item*
\item[content] The content of this news item*
\item[] *The introduction of any news item is included in the HTML content, thus will only be returned separately if the renderMarkdown parameter is set to TRUE. Otherwise the introduction property is null.
\end{enumerate}
\item[Errors] (none)
\item[Example]
\begin{lstlisting}
--> {"method":"getNewsDetailed", "params":["StudyTour", 430]}
<-- {"result": {
"id": 430,
"title": "Read our latest blog post!",
"category": "twitter",
"imageUrl": "https://pbs.twimg.com/profile_image.png",
"date": "2014-07-07T18:56:50+00:00",
"source": "StudyTour",
"breakout": false,
"author": "StudyTour",
"introduction": null,
"content": "<html><!--html contents--></html>"
}}
\end{lstlisting}
\end{enumerate}
\clearpage
\section{Narrowcasting Module}
\subsection{getBanners}
\begin{enumerate}
\item[Method] getBanners
\item[Description] Retrieves a list of sponsored banners.
\item[Authentication] (none)
\item[Parameters] (none)
\item[Returns] An array of dictionaries containing the following members:
\begin{enumerate}
\item[id] The ID of the banner
\item[name] The title of the banner
\item[image] An URL to the image of an banner
\end{enumerate}
\item[Errors] (none)
\item[Example]
\begin{lstlisting}
--> {"method":"getBanners", "params":[]}
<-- {"result": [{
"id": 15,
"name": "Super awesome company, work here!",
"image": "https://url.to/banner.png"
}]}
\end{lstlisting}
\end{enumerate}
\clearpage
\subsection{getNews}
\begin{enumerate}
\item[Method] getNews
\item[Description] Retrieves a list of recent news articles.
\item[Authentication] (none)
\item[Parameters] This method accepts the following parameters:
\begin{enumerate}
\item[amount] The amount of most recent items to return
\item[render\_markdown] A boolean that indicates whether you want to render markdown in the introduction and content to HTML, OPTIONAL, default false.
\end{enumerate}
\item[Returns] An array of dictionaries containing the following members:
\begin{enumerate}
\item[id] The id of this item
\item[title] The title of this item
\item[url] The url of this item
\item[publicationDate] The publication date of this news item. (RFC3339)
\item[introduction] A short introduction to this news article
\item[content] The content of this news article
\end{enumerate}
\item[Errors] (none)
\item[Example]
\begin{lstlisting}
--> {"method":"getNews", "params":[1]}
<-- {"result": [{
"title": "Read our latest blog post!",
"url": "/nieuws/304/2016/10/31/boeken-lenen-bij-inter-actief/",
"id": 304,
"publicationDate": "2014-07-04T12:29:06Z",
"introduction": "lalalala this is a _short_ intro.. Lees meer...",
"content": "Long long story."
}]}
--> {"method":"getNews", "params":[1, true]}
<-- {"result": [{
"title": "Read our latest blog post!",
"url": "/nieuws/304/2016/10/31/boeken-lenen-bij-inter-actief/",
"id": 304,
"publicationDate": "2014-07-04T12:29:06Z",
"introduction": "lalalala this is a <i>short</i> intro.. Lees meer...",
"content": "Long long story."
}]}
\end{lstlisting}
\end{enumerate}
\clearpage
\subsection{getTelevisionPromotions}
\begin{enumerate}
\item[Method] getTelevisionPromotions
\item[Description] Retrieves a list of promoted events.
\item[Authentication] (none)
\item[Parameters] (none)
\item[Returns] An array of dictionaries containing the following members:
\begin{enumerate}
\item[title] The title of the banner
\item[image] An URL to the image of an banner
\item[signup] True if it is possible to sign up for this activity, OPTIONAL
\item[signupStart] The start date of the signup period, OPTIONAL (RFC3339)
\item[signupStop] The signup deadline, OPTIONAL (RFC3339)
\item[signupMaximum] Maximum allowed attendees, OPTIONAL
\item[signupAvailable] Amount of current attendees, OPTIONAL
\end{enumerate}
\item[Errors] (none)
\item[Example]
\begin{lstlisting}
--> {"method":"getTelevisionPromotions", "params":[]}
<-- {"result": [{
"image": "https://url.to/promotion.png",
"title": "Water Skiing!",
"signupStart":"2014-07-03T18:56:50+00:00",
"signupStop":"2014-07-08T18:56:50+00:00",
"signupMaximum":40,
"signupAvailable":12
}]}
\end{lstlisting}
\end{enumerate}
\clearpage
\subsection{getHistoricActivitiesWithPictures}
\begin{enumerate}
\item[Method] getHistoricActivitiesWithPictures
\item[Description] Retrieves a list of a number of random activities between two dates that have pictures
\item[Authentication] OPTIONAL
\item[Parameters] This method accepts the following parameters:
\begin{enumerate}
\item[begin] The minimal end date, RFC3339 (inclusive)
\item[end] The maximal begin date, RFC3339 (exclusive)
\item[amount] The amount of activities
\end{enumerate}
\item[Returns] An array of dictionaries containing the following members:
\begin{enumerate}
\item[id] The identifier for this activity
\item[title] The title of this activity
\item[location] The location of this event.
\item[beginDate] The starting date and time of this event (RFC3339)
\item[endDate] The end date and time of this event (RFC3339)
\item[thumbnail] An URL to the thumbnail image for this event.
\item[source]: The source of this event (always "inter-actief")
\item[pictures]: An array of URL's to the individual pictures of this event.
\item[url]: The URL to the pictures page of this event.
\end{enumerate}
\item[Errors] (none)
\item[Example]
\begin{lstlisting}
--> {"method":"getHistoricActivitiesWithPictures", "params":["2014-07-01T00:00:00+02:00", "2014-07-31T23:59:59+02:00", 2]}
<-- {"result": [{
"id": 1337
"title": "Awesome Activity!",
"location": "SmartXP",
"beginDate": "2014-07-01T18:56:50+00:00",
"endDate": "2014-07-01T20:56:50+00:00",
"thumbnail": "https://url.to/image.png",
"source": "inter-actief",
"pictures": ["https://url.to/image.png", ...],
"url": "/activiteiten/1337/fotos"
}]}
\end{lstlisting}
\end{enumerate}
\clearpage
\section{Committee Module}
\subsection{getCommitteeStream}
\begin{enumerate}
\item[Method] getCommitteeStream
\item[Description] Retrieves a list of all committees.
\item[Authentication] (none)
\item[Parameters] (none)
\item[Returns] A dictionary of arrays of dictionaries containing the following members:
\begin{enumerate}
\item[id] The identifier for this committee
\item[name] The name of this committee
\item[imageUrl] An URL of a thumbnail for this committee
\end{enumerate}
\item[Errors] (none)
\item[Example]
\begin{lstlisting}
--> {"method":"getCommitteeStream", "params":[]}
<-- {"result": {"ICT": [{
"id": 12,
"name": "AppCie",
"imageUrl": "https://url.to/image.png"
}], "Travel":[...]
}}
\end{lstlisting}
\end{enumerate}
\clearpage
\subsection{getCommitteeDetailed}
\begin{enumerate}
\item[Method] getCommitteeDetailed
\item[Description] Retrieves details of committee, including its members
\item[Authentication] OPTIONAL
\item[Parameters] This method accepts the following parameters:
\begin{enumerate}
\item[id] The id of the requested item
\end{enumerate}
\item[Returns] A Dictionary containing the following fields:
\begin{enumerate}
\item[name] The name of this committee
\item[imageUrl] An URL of a logo for this committee
\item[founded] The date of this committee was founded (RFC3339)
\item[description] A description of this committee
\item[email] the email adress of this committee
\item[members] an array of dictionaries representing members of this committee:
\begin{enumerate}
\item[name] The full name of this member
\item[firstName] The first name of this member
\item[lastName] The family name of this member
\item[function] The function of this member within the committee
\item[phone] The phone number of this member, otherwise null*
\item[email] The email address of this member, otherwise null*
\item[] *Requires an authenticated call and being a member this committee
\end{enumerate}
\end{enumerate}
\item[Errors] (none)
\item[Example]
\begin{lstlisting}
--> {"method":"getCommitteeDetailed", "params":[12]}
<-- {"result": {
"id": 12,
"name": "AppCie",
"imageUrl": "https://pbs.twimg.com/profile_image.png",
"founded": "2011-07-07T18:56:50+00:00",
"description": "This committee develops and mantains the IApp",
"email": "[email protected]",
"members": [{
"name":"Donald Duck",
"firstName": "Donald",
"lastName": "Duck",
"function": "Quacker",
"phone": null,
"email": null
}}}
\end{lstlisting}
\end{enumerate}
\clearpage
\section{Company Module}
\subsection{getCompanyStream}
\begin{enumerate}
\item[Method] getCompanyStream
\item[Description] Retrieves a list of partnered companies.
\item[Authentication] (none)
\item[Parameters] (none)
\item[Returns] An array of dictionaries containing the following members:
\begin{enumerate}
\item[id] The identifier for this news item
\item[name] The title of this item
\item[imageUrl] An URL of a logo for this company
\end{enumerate}
\item[Errors] (none)
\item[Example]
\begin{lstlisting}
--> {"method":"getCompanyStream", "params":[]}
<-- {"result": [{
"id": 28,
"name": "University of Twente",
"imageUrl": "https://pbs.twimg.com/profile_image.png"
}]}
\end{lstlisting}
\end{enumerate}
\subsection{getCompanyDetailed}
\begin{enumerate}
\item[Method] getCompanyDetailed
\item[Description] Retrieves company details, including its promotional content.
\item[Authentication] (none)
\item[Parameters] This method accepts the following parameters:
\begin{enumerate}
\item[id] The id of the requested item
\end{enumerate}
\item[Returns] A Dictionary containing the following fields:
\begin{enumerate}
\item[name] The name of this company
\item[description] The HTML content of this news item
\end{enumerate}
\item[Errors] (none)
\item[Example]
\begin{lstlisting}
--> {"method":"getCompanyDetailed", "params":[28]}
<-- {"result": {
"name": "University of Twente",
"description": "<html><!--html contents--></html>"
}}
\end{lstlisting}
\end{enumerate}
\clearpage
\section{Activity Module}
\subsection{getActivityStream}\label{m:getActivityStream}
\begin{enumerate}
\item[Method] getActivityStream
\item[Description] Retrieves a combined list of \textit{regular}, \textit{educational} and \textit{external} activities.
\item[Authentication] OPTIONAL
\item[Parameters] This method accepts the following parameters:
\begin{enumerate}
\item[begin] The minimal end date, RFC3339 (inclusive)
\item[end] The maximal begin date, RFC3339 (exclusive)
\item[mixed] Boolean value indicating whether the client supports a result of mixed activity types, OPTIONAL, default False
\end{enumerate}
\item[Returns] An array of dictionaries containing the following members:
\begin{enumerate}
\item[id] The identifier for this activity
\item[title] The title of this activity
\item[beginDate] The starting date and time of this activity (RFC3339)
\item[endDate] The end date and time of this activity (RFC3339)
\item[location] The location of this activity
\item[category] The type of this activity (either "regular", "educational" or "external")
\item[url] The URL for this activity
\item[organizer] The organizer of this activity
\item[isDutch] Boolean value indicating whether the activity is Dutch-only
\end{enumerate}
\item[Errors] InvalidParamsError
\item[Example]
\begin{lstlisting}
--> {"method":"getActivityStream", "params":["2014-07-01T00:00:00+02:00", "2014-07-31T23:59:59+02:00", true]}
<-- {"result": [{
"id": 28,
"title": "Project Evening",
"beginDate": "2014-07-02T018:00:00+02:00",
"endDate": "2014-07-03T08:00:00+02:00",
"location": "Carre 2K",
"category": "regular",
"url": "/activiteiten/28/",
"organizer": "Bestuur",
"isDutch": false
}, {...}, {...}]}
\end{lstlisting}
\end{enumerate}
\clearpage
\subsection{getActivityDetailed}\label{m:getActivityDetailed}
\begin{enumerate}
\item[Method] getActivityDetailed
\item[Description] Retrieves details of an event, including its signup options if available
\item[Authentication] OPTIONAL
\item[Parameters] This method accepts the following parameters:
\begin{enumerate}
\item[id] The id of the requested item
\end{enumerate}
\item[Returns] All fields returned by getActivityStream (\autoref{m:getActivityStream}) additional to:
\begin{enumerate}
\item[organizer] The organizer of this activity
\item[description] The description of this activity
\item[html] The HTML description of this activity
\end{enumerate}
\item[] \textit{If the category of the activity equals "regular", additional fields will be returned.\\Please refer to: \autoref{m:getActivityDetailedRegular}}
\item[Errors]
NotLoggedInError: Invalid or no authentication token received \\
DoesNotExistError: The object requested does not exist
\item[Example]
\begin{lstlisting}
--> {"method":"getActivityDetailed", "params":[28]}
<-- {"result": {
...,
"organizer": "Bestuur",
"description": "Super cool awesome activity with pizza!"
"html": "<p>Super cool awesome activity with pizza!</p>"
}}
\end{lstlisting}
\end{enumerate}
\clearpage
\subsection{getActivityDetailed ("regular" category)}\label{m:getActivityDetailedRegular}
\begin{enumerate}
\item[Method] getActivityDetailed
\item[Description] Retrieves details of an event, including its signup options if available
\item[Authentication] OPTIONAL
\item[Parameters] This method accepts the following parameters:
\begin{enumerate}
\item[id] The id of the requested item
\end{enumerate}
\item[Returns] All fields returned by getActivityDetailed (\autoref{m:getActivityDetailed}) additional to:
\begin{enumerate}
\item[imageUrl] An URL to the graphic attached to this activity, can be null
\item[signupRequired] true if signup is required, otherwise false
\item[availability] The maximum amount of attendees, 0 if no maximum
\item[signupStart] The time at which enrollment opens (RFC3339)
\item[signupStop] The time at which enrollment closes (RFC3339)
\item[signedUp] true if logged in and signed up, otherwise false
\item[resignAvailable] true if it is possible to sign out, otherwise false
\item[signupAvailable] true if it is possible to sign up, otherwise false
\item[price] The base costs for enrollment, or total costs when signed up, 0 if no price
\item[pictures] An array of URLs to pictures for this activity, or an empty array
\item[thumbnails] A dictionary with the following properties:
\begin{enumerate}
\item[small] An URL to the \textit{small} thumbnail, can be null
\item[medium] An URL to the \textit{medium} thumbnail, can be null
\item[large] An URL to the \textit{large} thumbnail, can be null
\item[original] An URL to the \textit{original} thumbnail, can be null
\end{enumerate}
\item[options] an array of dictionaries representing signup options:
\begin{enumerate}
\item[id] the ID of this option
\item[type] either "question", "checkbox" or "selectbox"
\item[question] the description of this option
\item[price] additional costs, only present for the checkbox type
\item[required] true if this question or selectbox requires an answer.
\item[choices] array of dictionaries representing choices for the selectbox:
\begin{enumerate}
\item[id] the ID of this choice
\item[dish] the dish name of this choice
\item[restaurant] the restaurant name of this choice
\item[price] the additional costs of this choice
\end{enumerate}
\end{enumerate}
\end{enumerate}
\item[Errors] All errors returned by getActivityDetailed (\autoref{m:getActivityDetailed})
\item[Example] Please refer to page \pageref{example:getActivityDetailedRegular}
\end{enumerate}
\clearpage
\label{example:getActivityDetailedRegular}
\begin{lstlisting}
--> {"method":"getActivityDetailed", "params":[28]}
<-- {"result": {
...,
"imageUrl": "https://pic0",
"signupRequired": true,
"availability": 50,
"signupStart": "2014-07-02T018:00:00+02:00",
"signupStop": "2014-07-02T018:00:00+02:00",
"signedUp": false,
"resignAvailable": true,
"signupAvailable": true,
"price": 50.00,
"pictures": ["https://pic1", "https://pic2"],
"thumbnails": {
"small": "https://pic1/small/",
"medium": "https://pic1/medium/",
"large": "https://pic1/large/",
"original": "https://pic1/original/"
},
"options": [{
"id":123,
"type": "selectbox",
"question": "what kind of pizza? (Joe Pizza)",
"required": true,
"choices": [{"id":87, "dish": "Hawaii", "restaurant": "Joe Pizza", "price":6.0},
{"id":88, "dish": "Salami", "restaurant": "Joe Pizza", "price":7.0}]
},{
"id":124,
"type": "checkbox",
"question": "Super priority delivery",
"price": 2.0
},{
"id":125,
"type": "question",
"question": "what's your mothers maiden name?",
"required": true
},{...}]
}}
\end{lstlisting}
\clearpage
\subsection{getLatestActivitiesWithPictures}
\begin{enumerate}
\item[Method] getLatestActivitiesWithPictures
\item[Description] Retrieves a list of most recent activities that have pictures.
\item[Authentication] OPTIONAL
\item[Parameters] This method accepts the following parameters:
\begin{enumerate}
\item[amount] The amount of activities
\end{enumerate}
\item[Returns] All fields returned by getActivityStream (\ref{m:getActivityStream}) in addition to:
\begin{enumerate}
\item[pictures] An array of URLs to pictures for this activity, or an empty array