Menu Close

Description of the RESTAPI interface for uploading results

If the option to upload results using this interface is set in the race definition, it is assumed that there is a service implemented at that address that can accept a POST request that contains JSON data as the request body that contains the complete results information for that race.
The JSON content contains the main keys:

{“data”:[…], “race”:{…}, “structure”:[…]}

  • data – the value for this key is a field containing the results data for each racer. The names of the keys in the results of one racer are intentionally abbreviated and their meaning can be found in the value for the key “structure”.
  • race – the value of this key is an object containing almost all the information about the race to which the results relate.
  • structure – the value for this key is an array containing information about the individual “columns” in the results. Here you can see the human caption of the column (caption), its name that is used in the “data” section and the data type (type). In the case of a column that is created from data resulting from individual race segments, the “segment” and “flag” entries are still available. The “segment” item contains the index of the segment concerned and the “flag” item contains information about the type of the result – i.e. the flag set.

Meanings of “type” in “structure” data:

  • i – integer number
  • n – floating point number
  • n1 – number with one decimal place
  • n2 – number with two decimal places
  • s – text string – string
  • e:* – enumeration type – the colon is followed by the name of the enumeration type
  • d – date – in ISO format
  • t – time – in ISO format
  • m or mg – duration expressed as text
  • b – bool value
  • j – data of individual cycles
  • sr – tempo/pace – mm:ss expressed as a string

Meanings of “flag” in “structure” data:

  • show_loops – Loops – number of loops
  • show_duration – Duration
  • show_duration2 – Duration (indexed)
  • show_time – Time
  • show_time2 – Time (indexed)
  • show_tempo – Tempo
  • show_tempo2 – Tempo (indexed)
  • show_speed – Speed
  • show_speed2 – Speed (indexed)
  • show_length_m – Length (m)
  • show_length_km – Length (km)
  • show_chip – Chip
  • show_best_loop – Best loop
  • show_avg_loop – Average loop
  • show_last_loop – Last loop

In addition to the data, the Authorization item is added to the request header and its content is set to "Bearer "+{API_TOKEN}. In the API implementation, it is recommended to check the Authorization item and return the 401 – Unauthorized response status code if it does not exist, or if the value is different from the requested one.
In case of authorized access, a response with status 200 is expected.