Skip to content

Competition example

John Caprez edited this page Apr 16, 2020 · 1 revision

The below example outlines the procedures before and during a competition.

All URL used in this example are for demonstrative purposes only. Please navigate the API starting from the root URL to to find the corresponding URL for your application.

Obtain the competition ID

The competition ID is used in many of the bellow steps an must be obtained as a first step.

If you have trouble locating it with the following methods please contact it-services@worlddancesport.org.

  • By API
    • Query the API at /api/1/competition
    • Reduce the list by using the "from" and/or "to" filters matching the dates of your competitions.
    • Locate your competition by matching location, discipline, etc.
    • The Id column contains the competition Id
  • In calendar

Prepare officials

To be able to submit competition results the API needs to know who is adjudicating the competition.

To add officials you must know their MIN.

A MIN can be obtained by:

  • The API
    • Query the API at /api/1/person
    • Reduce the list by using the type=Adjudicator and name=[adjudicators name] filter
    • The Id column is the MIN
  • The adjudicators list

Register the official at the competition:

POST /api/1/official

<official>
  <task>Adjudicator</task>
  <letter>B</letter>
  <min>10001422</min>
  <competitionId>42694</competitionId>
</official>

The API will respond:

<status>
  <code>201</code>
  <message>Official created</message>
  <id>8708</id>
  <link
	rel="http://services.worlddancesport.org/rel/competition/official"
	type="application/vnd.worlddancesport.official+xml"
	xlink:href="https://services.worlddancesport.org/api/1/official/8708"/>
</status>

Store the value locally as it is used when you submit results or want to change/delete data of this competition official.

Prepare participants

It is recommended to register all couples of a competition at the API before the competition starts. This will allow the public to see who is participating at this competition.

Couples are identified by their ID.

To obtain a couple ID browser the API at /api/1/couple and use the min and/org name filter to locate a couple. The Id column is the couple Id.

Register the couple as a participant at the competition:

POST /api/1/participant

<participant kind="couple">
  <number>21</number>
  <status>Present</status>
  <competitionId>42694</competitionId>
  <coupleId>rls-4588</coupleId>
</participant>

The API will respond:

<status>
  <code>201</code>
  <message>Particiapnt created</message>
  <id>152341</id>
  <link
	rel="http://services.worlddancesport.org/rel/competition/particiapnt"
	type="application/vnd.worlddancesport.participant.couple+xml"
	xlink:href="https://services.worlddancesport.org/api/1/participant/152341"/>
</status>

Store the value locally as it is used when you submit results or want to change/delete data of this participant.

Submit results

After each round the results including the rank of the couples that are not reaching the next round can be submitted to the API.

Submit results of a couple:

PUT /api/1/particiapant/152341

<participant>
  <rank>25</rank>  
  <rounds>
	<round name="1">
	  <dances>
		<dance name="WALTZ">
		  <scores>
			<mark adjudicator="8708" />
			<mark adjudicator="8709" />
		  </scores>
		</dance>
		<dance name="TANGO">
		  <scores>
			<mark adjudicator="8708" />
		  </scores>
		</dance>
...
	 </dances>
   </round>
 </rounds>
<participant/>

Closing the competition

Once all rounds are completed and the results of the finalists have bee sent to the API the competition can be marked as closed.

Closing a competition will calculate the competition coefficient and assign WRL points to the couples.

PUT /api/1/competition/42694

<competition>
  <status>Closed</status>
</competition>`

Clone this wiki locally