API V2.0

Version 5.1 by Treyfane Dingo on 2023/09/25 22:43

The L.A.S.S.I.E. API V 2.0 can be reached via

https://api.lassie.online/api/lassie/v2.0

Required POST Parameters

The parameters have to be send as URLencoded form data. The API needs at least two parameters to work:

  • apikey
  • request
  • command (optional)

The API-Key has to be set in "System Settings". Preferrably a longer and unique key (like a MD5SUM). An specific API key can only be used for a corresponding request type.

Requests and Commands
RequestCommandDescription
lostandfounddblostandfound(Default) Returns all active (not returned) lost & found items from the Lost & Found Database
lostReturns all active (not returned) lost items from the Lost & Found Database
foundReturns all active (not returned) found items from the Lost & Found Database
returnedReturns all inactive / returned items from the Lost & Found Database
briefings Returns all briefings (i.e. Security News) classified as PUBLIC

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.

Example (CURL)

curl -X POST -d "apikey=ae629a834729fd3aac6d1f827b1793b0" -d "request=lostandfounddb" https://api.lassie.online/api/lassie/v2.0

This example will display the entire Lost & Found Database of FTC.

curl -X POST -d "apikey=ae629a834729fd3aac6d1f827b1793b0" -d "request=lostandfounddb" -d "command=lost" https://api.lassie.online/api/lassie/v2.0

This example will display only the lost items of the Lost & Found Database of FTC.

Output

The output of an valid request to the API will be a JSON-Object like the following examples:

Lost & Found Database

{"data":[{"id":"1","image":"https:\/\/api.lassie.online\/lassie\/images\/lostandfound_db\/9a7a1039bcbe887ed2f57a5b64c56c51.png","title":"A Piece of Cake","description":"Just another piece of cake","status":"F","lost_timestamp":"","found_timestamp":"2021-06-22 19:08:16","return_timestamp":""}]}

Lost & Found fieldset
KeyFieldNULL
idNumeric value, PRIMARY KEY-
imageURLnull
thumbURLnull
titleTextempty string
descriptionTextempty string
statusL | F | R (Lost, Found or Returned)-
lost_timestampISO datenull
found_timestampISO datenull
return_timestampISO datenull

Briefings Database

{"data":[{"id":"17","class":"P","topic":"UPDATE - Security News 21.12.2021","content":"<div id=\"briefing_content_content\"><div><b>Germany cancelled New Years Eve<\/b><\/div><div>Although it might calendar wise be unwise, Germany just cancelled New Years Eve. Further information can be obtained elsewhere.<\/div><div><br><\/div><div><b>Some things found<\/b><\/div><div>Security\r\n wants to remind all attendees that information about lost or found \r\nitems can be obtained via the APP or the Website of the convention. Lost\r\n &amp; Found is maintained by security and located in the security \r\noffice.<\/div><div><br><\/div><div><b>Quote of the day<\/b><\/div><div>\"Where is your neighbor?\"<\/div><div>\"He's in the garden ...\"<\/div><div>\"I can't see him ...\"<\/div><div>\"Oh, you'd have to dig quite a bit ...\"<br><\/div><div><br><\/div><\/div>","ops_id":"112","datetime_creation":"2021-12-21 22:19:45","datetime_lastchange":"","datetime":"2021-12-21 22:19:45"}]}

Briefings fieldset
KeyFieldNULL
idNumeric value, PRIMARY KEY-
classP (hopefully only P)-
topicTextempty string
contentHTMLempty string
ops_idNumeric value, the L.A.S.S.I.E. ID of the creator-
datetime_creationISO date-
datetime_lastchangeISO datenull
datetimeISO date which should be displayed. Is creation or lastchange whatever is bigger.-

Empty Object

{"data":[]}

Error Codes

The API will send a JSON-Object upon errors

{"error":{"code":"503","message":"Maintenance Mode enabled - please try again later"}}

The following error codes are implemented:

Error Codes
CodeMessageDescription
401UnauthorizedAPI-Key is not correct or no API-Key provided.
500Internal server errorMost likely the mySQL-Connection failed. A certain Dingo might be rather busy at this time.
501Bad or no requestWhatever you send, it wasn't a valid request.
503Maintenance Mode enabled - please try again laterMight follow an error 500 and the Dingo is still busy ...