FAQEventor

From tTiMe
Jump to: navigation, search

Eventor entry download and splash screen when down- or uploading

Data exchange between Eventor and event software using the Eventor API

This document describes how event administration software, from here on called event software, can interact with the Eventor API to exchange data, e g entry lists, start lists and result lists. Workflow


  1. Typically, the event is set up in Eventor a few weeks or months in advance. During this process, various pieces of information such as event name, date, organising clubs, classes, entry fees and deadlines are specified.
  2. Competitors make their entries to the event.
  3. A few days or weeks before the event, the organiser transfers the information to the event software.
  4. Start list draws, addition of entries from outside Eventor, and other tasks are performed in the event software.
  5. The start list is uploaded to Eventor.
  6. The organiser transfers late entries to the event software.
  7. The start list, including late entries, is uploaded to Eventor.
  8. The event takes place.
  9. Results are uploaded to Eventor.

Using the API

The API base address is https://eventor.orientering.se/api (for Sweden) or https://eventor.orientering.no/api (for Norway). The addresses below should be prefixed with the base address, e g /export/clubs becomes https://eventor.orientering.se/api/export/clubs. For each request, the http headers Username and Password should be set to the Eventor username and password of the user. This is to ensure that the user has access to the event (i e is an event administrator of any of the organising clubs). No API key is needed in this case.

For more information about how to use the API, please see the documentation at https://eventor.orientering.se/api/documentation.

Downloading data from Eventor to the event software

Clubs

GET /export/clubs

Returns all clubs. This information, together with the competitors, is handy when registering entries on the event day.

Competitors

GET /export/competitors?organisationIds={organisationIds}&includePreselectedClasses={includePreselectedClasses}

Returns all competitors, i e all persons and their club memberships. Omit the organisationIds parameter to download all competitors in Eventor.

GET /export/cachedcompetitors?organisationIds={organisationIds}&includePreselectedClasses={includePreselectedClasses}&zip={zip}

The same as above, but using prebuilt files on the Eventor server for faster access, and also gives the ability to download the files in zip format. These files are rebuilt each hour.

Base classes

GET /export/baseclasses

Returns all base classes in Eventor.

Event

GET /export/event?eventId={eventId}

Returns information about the specified event.

Classes

GET /export/classes?eventId={eventId}

Returns all classes for the specified event.

Entries

GET /export/entries?eventId={eventId}

Returns all entries for the specified event.

Services

GET /export/services?eventId={eventId}

Returns all services for the specified event.

Service requests

GET /export/servicerequests?eventId={eventId}

Returns all service requests (service orders for organisations and persons) for the specified event.

Uploading data from the event software to Eventor

Start list

POST /import/startlist

Uploads a start list in IOF XML format to Eventor. Any existing start list is replaced with the new one. The names of the classes must be the same in both systems. The correct event id and event race id must be set in the appropriate elements of the XML document. The file can be zipped, and should be placed in the http request body.

Result list

POST /import/resultlist

Uploads a result list in IOF XML format, including split times, to Eventor. Any existing result list is replaced with the new one. The names of the classes must be the same in both systems. The correct event id and event race id must be set in the appropriate elements of the XML document. The file can be zipped, and should be placed in the http request body.

PHP

// cURL används, se http://www.php.net/manual/en/book.curl.php 
$baseUrl = "https://eventor.orientering.se/api/"; 
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL,  
           $baseUrl . "events?fromDate=2010-04-01&toDate=2010-04-30"); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt($ch, CURLOPT_HTTPHEADER,  
           array("ApiKey: 058b7db0e5714f779d8821e7fbcd0307")); 
$responseString = curl_exec($ch); 
curl_close($ch); 

C#/.NET

var baseUrl = "https://eventor.orientering.se/api/"; 
var client = new System.Net.WebClient(); 
client.Headers.Add("ApiKey", "058b7db0e5714f779d8821e7fbcd0307"); 
var bytes = client.DownloadData(baseUrl + 
 "events?fromDate=2010-04-01&toDate=2010-04-30"); 
var responseString = System.Text.Encoding.UTF8.GetString(bytes);

Perl

use LWP::UserAgent;
use URI::https;
use LWP::Protocol::https;
use LWP::Authen::Basic;
sub eventorApiCallGet2
{
   my ( $url , $apikey, $username, $password) = @_;
   my $ua = LWP::UserAgent->new;
   if (defined($apikey) && $apikey ne "")
   {
       $ua->default_header(ApiKey =>  $apikey);
   }
   else
   {
       $ua->default_header(Username =>  $username);
       $ua->default_header(Password =>  $password);
   }
   $ua->agent("Perlmonky");
   $ua->timeout(10);
   my $u = "https://".EVENTOR_API_BASE_URL . $url;
   my $res = $ua->get($u );
   if ( !$res->is_success() )
   {
       return ("", $res->status_line);
   }
   return ($res->content, "");
}
sub eventorApiCallPost
{
   my ( $url , $apikey, $username, $password, $data) = @_;
   my $ua = LWP::UserAgent->new;
   $ua->agent("Perlmonky");
   $ua->timeout(10);
   my $u = "https://".EVENTOR_API_BASE_URL . $url;
   my $res;
   if (defined($apikey) && $apikey ne "")
   {
       $res = $ua->post($u, ApiKey =>  $apikey, Content => $data);
   }
   else
   {
       $res = $ua->post($u, Username =>  $username, Password =>  $password, Content => $data);
   }
   if ( !$res->is_success() )
   {
       return ($res->status_line);
   }
   return ("");
}

XML

Status event

  • 1 Ansökt
  • 2 Godkänd av distriktet
  • 3 Godkänd av SOFT
  • 4 Skapad (för tävlingar utan ansökningsprocedur)
  • 5 Anmälan öppnad
  • 6 Anmälan pausad
  • 7 Anmälan stängd
  • 8 Pågående
  • 9 Genomfört
  • 10 Inställt
  • 11 Rapporterat

I praktiken används inte 8 och 11 än.


Status of competitor - valid values for IOF xml format

  • Inactive : Has not yet started
  • DidNotStart : Did Not Start (in this race)
  • Active : Currently on course
  • Finished : Finished but not validated
  • OK : Finished and validated
  • MisPunch : Missing Punch
  • DidNotFinish : Did Not Finish
  • Disqualified : Disqualified
  • NotCompeting : Not Competing (running outside the competition)
  • SportWithdr : Sporting Withdrawal (e.g. helping injured)
  • OverTime : Overtime, i.e. did not finish within max time
  • Moved : Moved to another class
  • MovedUp : Moved to a "better" class, in case of entry restrictions
  • Cancelled : The competitor has cancelled his/hers entry
Personal tools