Documentation of MeOS REST API

Competition

Syntax:
/meos?get=competition
Returns:

MOP Competition XML

Example:
*MOPComplete>
 *competition date="2015-09-06" organizer="Orienteringsklubben Linné" homepage="http://www.oklinne.nu" zerotime="216000">Stafett-DM, Uppland*/competition>
*/MOPComplete>

Classes

Syntax:
/meos?get=class
Returns:

MOP Classes XML

Example:
*MOPComplete>
 *cls id="1" ord="10" radio="90,130;90,130;90,130">D21*/cls>
 *cls id="100" ord="1000" radio="90,130">M7*/cls>
*/MOPComplete>
Remarks: The attribute ord should be used to sort classes. The attribute radio lists the MeOS default radio control for each class and leg. Each leg of the class is separated by ';' and each radio control within a leg with ','. Note that you may query for results at any control; the listed controls are only for convenience.

Controls

Syntax:
/meos?get=control
Returns:

MOP Controls XML

Example:
*MOPComplete>
  *control id="31">[31]*/control>
  *control id="32">[32]*/control>
  *control id="50">Radio 1*/control>
*/MOPComplete>

Competitors

Syntax:
/meos?get=competitor
/meos?get=competitor#class=*c1>,*c2>,...
Arguments: Returns:

MOP Competitors XML

Example:
*MOPComplete>
  *cmp id="3565" card="101050">
    *base org="570" cls="5" stat="1" st="360000" rt="20580" nat="NOR">Elsa Winter*/base>
    *input it="20340" tstat="1"/>
  */cmp>
  *cmp id="55851">
    *base org="134" cls="7" stat="1" st="380710" rt="46910" nat="SWE">Anna Spring*/base>
  */cmp>
*/MOPComplete>
Remarks: Please refer to the MOP documentation for a complete description of all attributes. Below is a quick reference.

Teams

Syntax:
/meos?get=team
/meos?get=team#class=*c1>,*c2>,...
Arguments: Returns:

MOP Teams XML

Example:
*MOPComplete>
  *tm id="2928771">
    *base org="396" cls="5" stat="1" st="360000" rt="65770">IF Thor 1*/base>
    *r>34346;48866,866,0;32609*/r>
  */tm>
  *tm id="2928346">
    *base org="134" cls="5" stat="1" st="360000" rt="99660">OK Enen 1*/base>
    *r>42020;55851;35732*/r>
  */tm>
*/MOPComplete>
Remarks: Please refer to the MOP documentation for a complete description of all attributes. Below is a quick reference.

Organizations and Clubs

Syntax:
/meos?get=organization
Returns:

MOP Organization XML

Example:
*MOPComplete>
  *org id="1012">BAOC*/org>
  *org id="598">Dalaportens OL*/org>
  *org id="133">Enebybergs IF*/org>
  *org id="140">Falkenbergs OK*/org>
*/MOPComplete>

Recent Competition Changes

Purpose: Keep a separate database with results synchronized with MeOS.
Syntax:
/meos?difference=zero
/meos?difference=*nextdifference>
Returns:

Complete or difference MOP of changes since last time API was called. Use litteral 'zero' to obtain a new set of differences (the difference from zero). The returned data includes an attribute nextdifference that you use as argument in the nex call to difference, to get changes since this call.

Example:

Start by invoking /meos?difference=zero. The returned data will look like:

*MOPComplete nextdifference="332617">
  ...
*/MOPComplete>
Next time, you invoke /meos?difference=332617, which may return
*MOPDiff nextdifference="324254">
  ... 
*/MOPDiff>
Next time you use difference=324254 and so on. Note that under some circumstances, you may also get a complete event instead of a difference. See the general MOP documentation.

Results

Syntax:
/meos?get=result
/meos?get=result#preliminary=false
/meos?get=result#class=*c1>,*c2>,...
/meos?get=result#to=*c1>
/meos?get=result#from=*c1>
/meos?get=result#leg=*leg>
/meos?get=result#module=*module>
/meos?get=result#module=*module>#argument=*arg>
/meos?get=result#limit=*limit>
/meos?get=result#total=*true/false>
/meos?get=result#type=*type>
Arguments: Returns:

MOP Individual or Team Result XML. The result list is sorted according to the result. Note than disqualified competitors are also included; for example a competitor with status *DNS> will be returned with this status for all radio controls. You may want to filter out such entries, depending on your application.

Examples:

Individual results at the finish.

*MOPComplete>
  *results location="Finish">
    *person cls="100" stat="1" st="387240" rt="21880" place="1">
      *name id="134940">Isac Ulvesson*/name>
      *org id="2184">BOIC*/org>
    */person>
  
    *person cls="100" stat="1" st="387700" rt="22720" place="2">
      *name id="134923">Anne Brahe*/name>
      *org id="2253">IFA*/org>
    */person>
  
    *person cls="100" stat="1" st="382570" rt="23260" place="3">
      *name id="134914">Dan Andersson*/name>
      *org id="5938">OK Kompassen*/org>
    */person>
  */results>
*/MOPComplete>

Team results, leg 2 at Radio 1, leg has three parallel runners.

*MOPComplete>
  *results leg="2" location="Radio 1">
    *team cls="6" stat="1" st="372000" rt="32030" place="1">
      *name id="2927509">OK Linné 1*/name>
      *org id="84">OK Linné*/org>
      *person cls="6" leg="2" stat="1" st="392720" rt="11310">
        *name id="52054">John Woods*/name>
        *org id="84">OK Linné*/club>
      */person>
  
      *person cls="6" leg="3" stat="3" st="392720">
        *name id="134850">Ralph Audoro*/name>
        *org id="84">OK Linné*/org>
      */person>
  
      *person cls="6" leg="4" stat="1" st="392720" rt="12850">
        *name id="134851">Niel Success*/name>
        *club id="84">OK Linné*/club>
      */person>
  */team>
  */results>
*/MOPComplete>

Roganing results, Invoke with argument module=rogaining, which is a built in module.

*MOPComplete>
  *results module="rogaining" location="Finish">
    *person cls="1" stat="1" score="26" st="324000" rt="72550" place="1">
      *name id="4">Omar Rue*/name>
    */person>
    
    *person cls="1" stat="1" score="25" st="324000" rt="72730" place="2">
      *name id="3">Oscar Wilde*/name>
    */person>
  
    *person cls="1" stat="1" score="25" st="324000" rt="72780" place="3">
      *name id="5">Alice Alison*/name>
    */person>
    
    *person cls="1" stat="5" score="26" st="324000" rt="72590">
      *name id="6">Reimund Rossinger*/name>
    */person>
  */results>
*/MOPComplete>
Remarks: When and only when the type is CourseIndividual, the attribute course is included.
*person cls="1" stat="1" st="324000" rt="72550" place="1" course=28>
  *name id="4">Jordan Griesmer*/name>
*/person>

Status

Syntax:
/meos?get=status
Returns:

MeOS Status Data. Includes MeOS version and competition name id, which also is the name of the database used, if any.

Example:
*MOPComplete>
 *status version="3.6.1029" eventNameId="meos_20190223_212818_2FD" onDatabase="1"/>
*/MOPComplete>

Entry Classes

Syntax:
/meos?get=entryclass
Returns:

Classes where entry is allowed via the API.

*EntryClasses>
  *Class id="5">
    *Name>U1*Name>
    *Fee>70 kr*/Fee>
    *MaxAge>16*/MaxAge>
    *Start>Start 1*/Start>
    *AvailableStarts>30*/AvailableStarts>
  */Class>
*/EntryClasses>

Lookup competitor

Syntax:
/meos?lookup=competitor&id=*id>
/meos?lookup=competitor&card=*card>
/meos?lookup=competitor&bib=*bib>
/meos?lookup=competitor&name=*name>&club=*club>
Returns:

Competitor including individual result.

Arguments:
*Competitors>
  *Competitor id="85">
    *Name>Nils Bor*/Name>
    *ExternalId>1234*/ExternalId>
    *Club id="84">OK Linné*/Club>
    *Class id="204">Men*/Class>
    *Card>16733*/Card>
    *Status code="1">OK*/Status>
    *Start>17:38:00*/Start>
    *Finish>18:22:21*/Finish>
    *RunningTime>44:21*/RunningTime>
    *Place>7*/Place>
    *TimeAfter>13:04*/TimeAfter>
    *Team id="26">OK Linné 2*/Team>
    *Leg>1*/Leg>
    *Splits>
      *Control number="1">
        *Name>[31]*/Name>
        *Time>6:25*/Time>
        *Analysis lost="1:11" behind="1:11" mistake="" leg="5" total="3"/>
      */Control>
      *Control number="2">
        *Name>Radio*/Name>
        *Time>12:50*/Time>
        *Analysis lost="1:10" behind="2:21" mistake="1:20" leg="3" total="3"/>
      */Control>
      ...
    */Splits>
  */Competitor>
*/Competitors>

Lookup Database Competitor

Syntax:
/meos?lookup=dbcompetitor&id=*id>
/meos?lookup=dbcompetitor&card=*card>
/meos?lookup=dbcompetitor&name=*name>&club=*club>
Returns:

Competitor from runner database. Note that a partial name may be submitted, and that several matching result may be returned, sorted by relevance. This query is suitable for auto complete functionality.

Arguments:
*DatabaseCompetitors>
  *Competitor id="15393">
    *Name>Anskar Dahl*/Name>
    *Club id="575">IFK Mora OK*/Club>
    *Card>79709*/Card>
    *Nationality>SWE*/Nationality>
    *Sex>M*/Sex>
    *BirthYear>1957*/BirthYear>
  */Competitor>
*/DatabaseCompetitors>

Lookup Database Club

Syntax:
/meos?lookup=dbclub&id=*id>
/meos?lookup=dbclub&name=*name>
Returns:

Club from club database. Note that a partial name may be submitted, and that several matching result may be returned, sorted by relevance. This query is suitable for auto complete functionality.

Arguments:
*DatabaseClubs>
  *Club id="134">
  *Name>OK Enen*/Name>
  */Club>
*/DatabaseClubs>

API New Entry

Syntax:
/meos?entry&id=*id>&class=*classid>&card=*card>
/meos?entry&name=*name>&club=*club>&class=*classid>&card=*card>¬iming
Arguments:

Returns: Status.

Note:
If the card number is registered as a rental card, it will be set as such and hiredCard will be set in the Fee attribute. The returned fee includes any rental card fee.

*Answer>
  *Status>OK*/Status>
  *Fee hiredCard="true">130*/Fee>
  *Info>Open Long, Rudolf Minowski (OK Tisaren)*/Info>
*/Answer>
*Answer>
  *Status>Failed*/Status>
  *Info>Out of maps.*/Info>
*/Answer>

Page template

Syntax:
/meos?page=*page>
Returns: Installed template file with the specified tag.

Image

Syntax:
/meos?image=*image>
Returns: Image, *image>.png, if installed in MeOS datafolder. MeOS logo if *image> is meos.

IOF XML Results

Syntax:
/meos?get=iofresult
/meos?get=iofresult#class=*c1>,*c2>,...
Arguments: Returns:

IOF XML version 3.0 result list.

IOF XML Startlist

Syntax:
/meos?get=iofstart
/meos?get=iofstart#class=*c1>,*c2>,...
Arguments: Returns:

IOF XML version 3.0 start list.