Wiki source code of API V1.0
Version 1.2 by Treyfane Dingo on 2023/05/27 01:24
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | The L.A.S.S.I.E. API V 1.0 can be reached via | ||
2 | |||
3 | {{{https://www.furcom.org/api/lassie/v1.0}}} | ||
4 | |||
5 | === Required POST Parameters === | ||
6 | |||
7 | The parameters have to be send as **URLencoded form data**. The API needs at least two parameters to work: | ||
8 | |||
9 | * apikey | ||
10 | * request | ||
11 | * command (optional) | ||
12 | |||
13 | The API-Key has to be set in "System Settings". Preferrably a longer and unique key (like a MD5SUM). | ||
14 | |||
15 | (% style="width:50%" %) | ||
16 | |=(% colspan="3" %)Requests and Commands | ||
17 | |=(% scope="col" %)Request|=Command|=Description | ||
18 | |(% rowspan="4" %)lostandfounddb|lostandfound|(Default) Returns all active (not returned) lost & found items from the Lost & Found Database | ||
19 | |lost|Returns all active (not returned) lost items from the Lost & Found Database | ||
20 | |found|Returns all active (not returned) found items from the Lost & Found Database | ||
21 | |returned|Returns all inactive / returned items from the Lost & Found Database | ||
22 | |briefings| |Returns all briefings (i.e. Security News) classified as PUBLIC | ||
23 | |||
24 | The request "lostandfounddb" without a command will return the active Lost & Found Database entries for the respective Convention as a JSON. This includes Links to the uploaded images. Thus, the information can be processed on an external Website, e.g. the convention's homepage. | ||
25 | |||
26 | === Example (CURL) === | ||
27 | |||
28 | {{{curl -X POST -d "apikey=ae629a834729fd3aac6d1f827b1793b0" -d "request=lostandfounddb" https://www.furcom.org/api/lassie/v1.0}}} | ||
29 | |||
30 | This example will display the entire Lost & Found Database of FTC. | ||
31 | |||
32 | {{{curl -X POST -d "apikey=ae629a834729fd3aac6d1f827b1793b0" -d "request=lostandfounddb" -d "command=lost" https://www.furcom.org/api/lassie/v1.0}}} | ||
33 | |||
34 | This example will display only the lost items of the Lost & Found Database of FTC. | ||
35 | |||
36 | === Output === | ||
37 | |||
38 | The output of an valid request to the API will be a JSON-Object like the following examples: | ||
39 | |||
40 | ==== Lost & Found Database ==== | ||
41 | |||
42 | {{{}}}} | ||
43 | |||
44 | (% style="width:50%" %) | ||
45 | |=(% colspan="3" %)Lost & Found fieldset | ||
46 | |=(% scope="col" %)Key|=Field|=NULL | ||
47 | |id|Numeric value, PRIMARY KEY|- | ||
48 | |image|URL|null | ||
49 | |title|Text|empty string | ||
50 | |description|Text|empty string | ||
51 | |status|L ~| F ~| R (Lost, Found or Returned)|- | ||
52 | |lost_timestamp|ISO date|null | ||
53 | |found_timestamp|ISO date|null | ||
54 | |return_timestamp|ISO date|null | ||
55 | |||
56 | ==== Briefings Database ==== | ||
57 | |||
58 | {{{}}}} | ||
59 | |||
60 | (% style="width:50%" %) | ||
61 | |=(% colspan="3" %)Briefings fieldset | ||
62 | |=(% scope="col" %)Key|=Field|=NULL | ||
63 | |id|Numeric value, PRIMARY KEY|- | ||
64 | |class|P (hopefully only P)|- | ||
65 | |topic|Text|empty string | ||
66 | |content|HTML|empty string | ||
67 | |ops_id|Numeric value, the L.A.S.S.I.E. ID of the creator|- | ||
68 | |datetime_creation|ISO date|- | ||
69 | |datetime_lastchange|ISO date|null | ||
70 | |datetime|ISO date which should be displayed. Is creation or lastchange whatever is bigger.|- | ||
71 | |||
72 | ==== Empty Object ==== | ||
73 | |||
74 | {{{{"data":[]}}}} | ||
75 | |||
76 | === Error Codes === | ||
77 | |||
78 | The API will send a JSON-Object upon errors | ||
79 | |||
80 | {{{{"error":{"code":"503","message":"Maintenance Mode enabled - please try again later"}}}}} | ||
81 | |||
82 | The following error codes are implemented: | ||
83 | |||
84 | (% style="width:50%" %) | ||
85 | |=(% colspan="3" %)Error Codes | ||
86 | |=(% scope="col" %)Code|=Message|=Description | ||
87 | |401|Unauthorized|API-Key is not correct or no API-Key provided. | ||
88 | |500|Internal server error|Most likely the mySQL-Connection failed. A certain Dingo might be rather busy at this time. | ||
89 | |501|Bad or no request|Whatever you send, it wasn't a valid request. | ||
90 | |503|Maintenance Mode enabled - please try again later|Might follow an error 500 and the Dingo is still busy ... |