#API# ######Version 0.2######
##Accessability## The API can be accessed under following URLs:
- https://pvpctutorials.de/VPlanApp/api.php
- https://pvpctutorials.de/VPlanApp/api/
- https://skirising.no-ip.org/VPlanApp/api.php
- https://skirising.no-ip.org/VPlanApp/api/
##Request##
Every API-request needs to specify at least the action parameter.
Parameters should be send over HTTP-POST
###Action### Possible actions are:
userfor accessing information about the specified usertickerfor getting the tickersreplacementsfor getting all replacements for the user's coursespagesfor getting special pages (i.e. before holidays)othersfor getting extra information for teachersauthfor validating login informationallfor getting a combination ofuser,replacements,ticker,pagesandothers
###Parameters###
apisends the API-version of the client (current version is0.2). Not needed but strongly recommended for compatibilityuspecifies the username. Needed for all actions.passspecifies the password.passorsyncandtokenare needed for all actions.appshould be sent by apps to tell the server their app name and versionosshould be sent by apps to tell the server their operating systemstatsshould be sent by apps for statistics.statsneeds to be a JSON-Object with possible valuesdata,wifi,android_idandadbsyncis a boolean indicating if this is a syncronization request.
Ifsyncistruea validtokencan be sent instead ofpasstokencan be sent withsync=truehashcan be sent to indicate the (recieved) hash of the cached datalangtwo character language code (strongly recommended forapi >= 0.2)
##Response##
Responses are JSON objects.
The root contains following elements:
resultalways: contains the resultsuccessalways: boolean indicating success of the requested actionhashalways: the SHA-256 hash ofresultchangedalways: boolean indicating difference between given hash and new hashauthorizedalways: boolean indicating valid logintokenifauthorized: a single use token valid for max. 24 hourslanguagealways: the language usedserve_timealways: the time needed for processing the requestdeprecatedif the action is deprecated: truewarningsif warnings occured: an array of warningsactionalways: the action performedparamsalways: the parameters from the request
###Result### The result depends on the action
In case of action all result is an object containing
user: the user inforeplacements: the replacementsticker: the tickerspages: the pagesothers: extra information for teachers
For other actions result immediately contains the requested informatin corresponding to the action:
####User Info#### The user info is a JSON-Object consisting of:
user: the usernameuid: the user idgid: the group id of the main groupgroup: the main groupgroups: array containing all the groups a user is infullname: the full name (normally first and last name) of the userstudent: boolean indicating if the user is not in the teachers grouptype: either 'student' or 'teacher'
####Replacements####
The array of replacements contains objects for every replacement.
These look like this for students:
idgrade_pre: the non-numeric first part of the classgrade: the numeric part of the classgrade_last: the non-numeric last part of the classlessonteacher: the short-code of the original teacherreplacement: the short-code of the replaceing teacher or emptyroomcommenttimestamp: the timestamp of the day the replacement occurstimestamp_update: the timestamp of the last updateaddition: boolean indicating if the replacement was just addedteacher_long: the full name of the original teacheris_today: boolean indicating if the replacement is for todayteacher_change: boolean indicating if the teacher is changed as a result of this replacement
And like this for teachers:
idshort: the short-code of the selected teacherteacher: full name of the specified teacherlessongrade: grade([short-code of original teacher])roomcommenttimestamp: the timestamp of the day the replacement occurstimestamp_update: the timestamp of the last updateaddition: boolean indicating if the replacement was just addedis_today: boolean indicating if the replacement is for today
####Tickers####
idautomatic: boolean indicationg if this ticker was generated from a note (see Others)value: the content of the tickerfrom_stamp: the earliest timestamp this ticker should occurto_stamp: the last timestamp this ticker should occurorder: if multiple tickers are active at the same time this specifies the order
####Pages####
idordern_num: ask @flx5content: the content of the page (HTML)timestamp_from: the earliest timestamp this page should occurtimestamp_end: the last timestamp this page should occurpupils: if this page should be displayed for pupilsteachers: if this page should be displayed for teachers
####Others####
idtype: one of t=teacher, g=grade, r=room, s=school, a=supervisor, n=note (are converted to tickers automatically)name: the name of the subjectcommenttimestamp: the timestamp of the day this occurstimestamp_update: the timestamp of the last updateaddition: boolean indicating if this was just addedis_today: boolean indicating if this is for today
####Auth####
The result is a boolean: true if logging in was successful, false otherwise
In case of false more information is found in the warnings
###Warning###
A JSON object containing
warning: the warning code
a description in the used language if available
other warning-specific fields