Skip to content

THIApp WebAPI Documentation

xBaun edited this page Mar 19, 2017 · 1 revision

Common API call settings

Paramter Value
Host https://hiplan.thi.de/webservice/production/index.php
HTTP-Method POST
Content-Type application/x-www-form-urlencoded
  • The server response is always a JSON Object.
  • The server always answers with status 200

Session Managment

Verify Session

Check if a Session-ID is still valid.

Request Body

Name Value Desc
service session
method isalive
session <SESSION ID> A valid session string
format json

Response

Name Value Desc
date <DATE> "18.03.2017
time <TIME> "21:37:22"
data <STRING> ---
status <NUMBER> ---
On session is invalid (Failure)

The data field contains "No Session".

e.g.:

{"date":"18.03.2017","time":"21:37:22","data":"No Session","status":-115}
On session is valid (Success)

The data field contains "STATUS_OK" and status field is 0.

e.g.:

{"date":"18.03.2017","time":"21:40:41","data":"STATUS_OK","status":0}

Create Session

Request Body

Name Value Desc
service session
method open
format json
username <USERNAME>
passwd <PASSWORD>

Response

Name Value Desc
date <DATE> "18.03.2017
time <TIME> "21:37:22"
data <ARRAY> ---
status <NUMBER> ---
On username and password are valid (Success)

The data field contains an Array with three values: ["<SESSION ID>","<USERNAME>",3] and status field is 0.

e.g.:

{"date":"18.03.2017","time":"21:37:22","data":["<SESSION ID>","<USERNAME>",3],"status":0}
On username and password are incorrect (Success)

The data field contains "Wrong credentials" and statusfield is -103.

e.g.:

{"date":"19.03.2017","time":"12:56:10","data":"Wrong credentials","status":-103}

Get Calendar Data

Read the student schedule.

Request Body

Name Value Desc
service thiapp
method stpl
format json
session <SESSION ID> A valid session id
day <START DAY>
month <START MONTH>
year <START YEAR>
details 0 TODO: Unknwon purpose

e.g.:

service=thiapp&method=stpl&format=json&session=<SESSION ID>&day=13&month=03&year=2017&details=0

Response

See Wiki-Page: Example Response: Calendar


Get Mensa Menu

Request Body

Key Value
service thiapp
method mesna
format json
session <SESSION ID> A valid Session-ID

e.g.

service=thiapp&method=mensa&session=<SESSION ID>&format=json

Response

See Wiki-Page: Example Response: Mensa Menu