Documentation Web-API
Web-based API to insert data automatically into the FS-live databases.
The API supports entering data to the database by calling competition and discipline specific URLs with POST parameters containing the actual data.
The basic syntax for the URLs is: http://fs-live.org/[COMPETITION]/api/process-[DISCIPLINE].php
[COMPETITION] has to be replaced with the country or the name of your FS/FSAE competition. It is the same as used in the links on the home page. If your competition isn't linked yet, please write an email and you will get the exact wording.
[DISCIPLINE] has to be replaced by the following abbrevations for the individual disciplines:
Discipline | Abbrevation in URL |
---|---|
Skid Pad | skid |
Acceleration | acc |
Autocross | autox |
Trackdrive | track |
Endurance | endu |
Team Infos
The team's basic data must be administrated by hand in the admin area on the website.
Parameter | Description | Example |
---|---|---|
class | C/E/D for combustion/electric/driverless respectively case insensitive |
E D d |
car nr. | The team's car number. Must be unique over all classes. You can use class dependent prefixes and leading zeroes. case insensitive |
70 007 D329 |
team name | The name of the team case sensitive |
Global Formula Racing E-Agle Trento Racing Einstein Motorsport |
team uni | The type(, name) and city of the university. Type and name may be abbrevated. case sensitive |
UNI Stuttgart ETSEIB Barcelona Metropolia UAS |
country | 3-character country code according to IOC case insensitive |
AUT CZE CAN |
POST parameters - general
You have to submit the data as POST parameters along the url call.
Some parameters are the same for each discipline, some differ over the disciplines.
Make sure the car numbers are spelled in the same way as in the team infos section over all disciplines. Leading zeroes make a difference because the car numbers are handled as text. Car numbers with class prefixes are case insensitive.
Times may be entered with a comma or a point as decimal seperator.
For Skid Pad, Acceleration and Autocross use time value 888 for DNF and 999 for RERUN.
The mode parameter (Trackdrive/Endurance only) defines if a lap time gets added or the vehicle state gets changed. If the value is another than "save" the other parameters are not evaluated and don't have to be submitted.
Value | Description |
---|---|
save | Enters a new lap with the given time. Automatically sets the vehicle state to "GO!". |
GO! | Sets the vehicle state to "GO!". Use at start into first lap and after pit stop. |
PIT | Sets the vehicle state to "PIT". Use when car enters driver change in Endurance. |
FIN | Sets the vehicle state to "FIN". Use if car has sucessfully finished Trackdrive/Endurance. |
DNF | Sets the vehicle state to "DNF". Use if car fails to complete Trackdrive/Endurance or gets disqualified. |
POST parameters - Skid Pad
Parameter | Description | Example |
---|---|---|
car_nr | The team's car number | c49 |
right | The time of the second right lap | 5.678 |
left | The time of the second left lap | 5,432 |
passkey | The event specific password | ******** |
POST parameters - Acceleration
Parameter | Description | Example |
---|---|---|
car_nr | The team's car number | 159 |
time | The time of the current attempt | 5.08 |
passkey | The event specific password | ******** |
POST parameters - Autocross
Parameter | Description | Example |
---|---|---|
car_nr | The team's car number | E014 |
time | The time of the current attempt | 08.150 |
passkey | The event specific password | ******** |
POST parameters - Trackdrive
Parameter | Description | Example |
---|---|---|
car_nr | The team's car number | D368 |
time | The time of the last lap | 147,852 |
try | The number of the current attempt | 1 |
mode | Input mode / vehicle status see POST parameters - general |
save, GO!, FIN, DNF |
passkey | The event specific password | ******** |
POST parameters - Endurance
Parameter | Description | Example |
---|---|---|
car_nr | The team's car number | 69 |
time | The time of the last lap | 43.21 |
mode | Input mode / vehicle status see POST parameters - general |
save, GO!, PIT, FIN, DNF |
passkey | The event specific password | ******** |
possible return values
The return value is a string delivered from the webserver indicating if an error occured during script execution. Error detection and signaling isn't implemented completely yet. Possible values are:
return value | Description |
---|---|
0 | task sucessful |
1 | wrong passkey |
2 | database connection error |
3 | corrupt data or sql error |
4 | too many laps |
5 | no input mode provided |
6 | reserved |
7 | reserved |
8 | reserved |
9 | reserved |
other strings | general PHP or HTTP error; for details read the return string check if url is correct on recurring PHP errors please contact me with the complete error string |