SAP Sailing Analytics Webservices API Version 1.0

URL: /api/v1/events/createEvent

Description:

Creates a new event. Optional parameters control how "deep" the structure is to be created, regarding a default regatta, leaderboard and leaderboard group. Furthermore, optional parameters control some of the most important attributes of the objects created. Reasonable defaults are supposed to make the consumption of this service simple.


Webservice Type: POST
Output format: {event-id}
Mandatory parameters: venuename or venuelat/venuelng must be provided, as follows
venuename the name of the venue; if not provided, venuelat and venuelng can be used, and the name of the town nearest to the coordinates will be used as a venue name then
venuelat decimal degrees; can be provided instead of a venuename, together with venuelng encoding the location of the event
venuelng decimal degrees; can be provided instead of a venuename, together with venuelat encoding the location of the event
Optional parameters:
eventName name of the event; defaults to a name constructed from the user name and a timestamp
eventdescription the event description text; defaults to the event name
startdate the event start date in ISO format (e.g., 2017-08-17T10:00:00+0200)
startdateasmillis (alternative to startdate) the event start date in milliseconds since the epoch (Unix time)
enddate the event end date in ISO format (e.g., 2017-08-19T20:00:00+0200)
enddateasmillis (alternative to enddate) the event end date in milliseconds since the epoch (Unix time)
ispublic a boolean value, true/false, telling whether the event shall be public
officialwebsiteurl URL of the official web site
baseurl event base URL; will be used in e-mails sent out, e.g., for registration; defaults to the base URL of this request
leaderboardgroupids IDs of the leaderboard groups to add to the new event
createleaderboardgroup boolean; if true, a new leaderboard group will be created, named and described like the event; the new leaderboard group will be added to the event
createregatta boolean; if true, a new regatta will be created, named like the event; in this case, providing a value for boatclassname becomes mandatory; the regatta will have a "Default" series with a single "Default" fleet; a regatta leaderboard is created, and if a leaderboard group was also created, the regatta leaderboard will automatically be added to the new leaderboard group
boatclassname must be provided if createregatta=true; can be the display name or an alias name of a boat class to use for the new regatta
numberofraces tells how many races shall be created in the default series; by default the series remains empty
canBoatsOfCompetitorsChangePerRace If true, boats and competitors can change per race, also it is necessary to register them in this case for each race!
competitorRegistrationType defines the registration type for competitor self registration to the regatta. Allowed values are CLOSED (no self registration) or OPEN_UNMODERATED (self registration for competitors is allowed)
secret a string that is used to verify competitor self registrations, if not given the server will generate one
rankingMetric a string containing one of [ONE_DESIGN, TIME_ON_TIME_AND_DISTANCE, ORC_PERFORMANCE_CURVE]. Defaults to ONE_DESIGN if not specified.
scoringScheme a string containing a valid scoring scheme name.
leaderboardDiscardThresholds multiple int values that define the race column indices where discards start to be active. Defaults to an empty list if not given
Request method: POST
Example: curl -X POST -d "boatclassname=Star" -d "venuename=Walldorf" -H "Authorization: Bearer OuknIUZQyADsqcDDEEyvlr+aBIpB4iVBdjdRYJtdO1w=" "http://127.0.0.1:8888/sailingserver/api/v1/events/createEvent"
produces output
		{
		  "eventid": "b0d45c72-4c37-4026-aeb5-b38c5d4bcb3c",
		  "eventname": "Session admin 2019-06-06 00:12:25",
		  "eventstartdate": 1559772745414,
		  "eventenddate": 1560377545414,
		  "leaderboardgroupid": "58141c8e-d0c0-40eb-9adf-a2ba250d817f",
		  "regatta": "Session admin 2019-06-06 00:12:25",
		  "registrationSecret": "87b99bd8-c7ff-47b5-b299-19edb9f3a433",
		  "leaderboard": "Session admin 2019-06-06 00:12:25"
		}
		
Should an error result, you'll receive a JSON document in the body and a non-2XX response code, based on the following error code definitions: NO_VENUE(1), NO_BOAT_CLASS(2), LEADERBOARD_GROUP_ALREADY_EXISTS(3), REGATTA_ALREADY_EXISTS(4), LEADERBOARD_ALREADY_EXISTS(5):
		{
		  "message": "No venue specified; provide either venuename or venuelat/venuelng",
		  "errorCodeName": "NO_VENUE",
		  "errorCode": 1
		}
		
Back to Web Service Overview