SAP Sailing Analytics Webservices API Version 1.0

URL: /api/v1/leaderboard/{name}/results

Description:

The service is used to upload score corrections for a leaderboard. The user must be authenticated and must have the UPDATE permission on the leaderboard identified by {name}. A comprehensive result document is produced that lets the client understand if the import went OK, or if it was rejected because it was incomplete, and if (even only partially) successful, which parts were matched and imported, and which parts were unmatched and couldn't be associated with the leaderboard structure.


Webservice Type: REST
Output format: Json
Mandatory parameters: scoreCorrectionProvider: the name of a score correction provider. Currently understood score correction provider names are
  • "ISAF XML Regatta Result (XRR) Importer"
  • "Yachtscoring XRR Result Importer"
  • "Sailwave CSV result importer"
  • "Velum CSV result importer"
  • "Manage2Sail XRR Result Importer"
  • "Extreme Sailing Series 40 Scores from SailRacer.org"
  • "Kieler Woche Official Results by b+m"
  • "Barbados 2013 505 Worlds Excel Result Importer"
  • "FREG HTML Score Importer"
Needless to say that URL encoding is required for this query parameter.
Optional parameters: allowRaceDefaultsByOrder: (default: false) If true, the race numbers in the score correction document will be matched against the leaderboard's race column names in the order in which they appear, without checking that the race number/name provided in the results document matches the race column name exactly. Note that with this option enabled an unusual leaderboard format such as one that contains carry-over columns, e.g., between a qualification and a final series may cause mismatches in how the results are associated. Always validate the output!

allowPartialImport: (default: false) If true, a result document will be applied even if not all race numbers / names in the result document have been matched to existing race columns in the leaderboard, or if not all sail IDs / numbers in the result document were matched to existing competitor sail numbers in the leaderboard. Use this with caution and check the output which provides insights into what was matched and what wasn't.

timePointOfLastCorrectionValidityMillis: a time stamp in Unix time (milliseconds since 1970-01-01T00:00:00+0000) that tells the time stamp to set for this score correction. This will be shown on the leaderboard visualization.

comment: a comment to display with the leaderboard; this could for example hint at the status (official, preliminary, protests pending, based on tracking only, ...)

sailId: multiple occurrences of this parameter are allowed; used together with competitorId to specify how sail IDs/numbers are to be matched to competitors from the leaderboard during the import. The multiplicities of sailId and competitorId must match.

competitorId: see sailId; used to specify the competitor IDs to which to map the sailId at the corresponding parameter index; order matters

raceNumber: multiple occurrences of this parameter are allowed; used together with raceColumnName to specify how race numbers / names are to be matched to race column names from the leaderboard during the import. The multiplicities of raceNumber and raceColumnName must match.

raceColumnName: see raceNumber; used to specify the race column name to which to map the raceNumber at the corresponding parameter index; order matters

Request method: PUT
Payload: A result document in the format required by the provider selected with the scoreCorrectionProvider parameter, e.g., an XRR document for the "ISAF XML Regatta Result (XRR) Importer" provider
Example: curl -H 'Authorization: Bearer b+AfqiyGh6LySer4J4F/P9dU4MSPRt6PuJbFwwzCpo8=' -H 'Content-Type: application/octet-stream' -X PUT --data-binary @/path/to/XRR.xml "http://127.0.0.1:8888/sailingserver/api/v1/leaderboards/SomeLeaderboard/results?scoreCorrectionProvider=ISAF%20XML%20Regatta%20Result%20(XRR)%20Importer&sailId=GER%202098&competitorId=bc883750-4b79-0137-d3a6-60a44ce903c3&allowRaceDefaultsByOrder=true&allowPartialImport=true&comment=Preliminary"
Response: Status 200
		{
		  "complete": false,
		  "allowPartialImport": true,
		  "matchedSailIds": [
		    {
		      "sailId": "GER 2098",
		      "competitorId": "bc883750-4b79-0137-d3a6-60a44ce903c3"
		    }
		  ],
		  "matchedRaceNumbers": [
		    {
		      "raceNumber": "1",
		      "raceColumnName": "R1"
		    },
		    {
		      "raceNumber": "2",
		      "raceColumnName": "R2"
		    },
		    {
		      "raceNumber": "3",
		      "raceColumnName": "R3"
		    },
		    {
		      "raceNumber": "4",
		      "raceColumnName": "R4"
		    },
		    {
		      "raceNumber": "5",
		      "raceColumnName": "R5"
		    },
		    {
		      "raceNumber": "6",
		      "raceColumnName": "R6"
		    }
		  ],
		  "unmatchedSailIds": [
		    "GER 1031",
		    "GER 1230",
		    "DEN 1583",
		    "GER 1861",
		    "DEN 1500",
		    "GER 2038",
		    "GER 1103",
		    "DEN 63",
		    "GER 2091",
		    "DEN 1736",
		    "GER 2106",
		    "GER 606",
		    "GER 1911",
		    "GER 1912"
		  ],
		  "unmatchedRaceNumbers": [
		    "7",
		    "8"
		  ],
		  "applyResult": [
		    {
		      "raceNumber": "1",
		      "raceColumnName": "R1",
		      "competitors": [
		        {
		          "sailId": "GER 2098",
		          "competitorId": "bc883750-4b79-0137-d3a6-60a44ce903c3",
		          "score": 27,
		          "maxPointsReason": "NONE"
		        }
		      ]
		    },
		    {
		      "raceNumber": "2",
		      "raceColumnName": "R2",
		      "competitors": [
		        {
		          "sailId": "GER 2098",
		          "competitorId": "bc883750-4b79-0137-d3a6-60a44ce903c3",
		          "score": 11,
		          "maxPointsReason": "NONE"
		        }
		      ]
		    },
		    {
		      "raceNumber": "3",
		      "raceColumnName": "R3",
		      "competitors": [
		        {
		          "sailId": "GER 2098",
		          "competitorId": "bc883750-4b79-0137-d3a6-60a44ce903c3",
		          "score": 15,
		          "maxPointsReason": "NONE"
		        }
		      ]
		    },
		    {
		      "raceNumber": "4",
		      "raceColumnName": "R4",
		      "competitors": [
		        {
		          "sailId": "GER 2098",
		          "competitorId": "bc883750-4b79-0137-d3a6-60a44ce903c3",
		          "score": 28,
		          "maxPointsReason": "NONE"
		        }
		      ]
		    },
		    {
		      "raceNumber": "5",
		      "raceColumnName": "R5",
		      "competitors": [
		        {
		          "sailId": "GER 2098",
		          "competitorId": "bc883750-4b79-0137-d3a6-60a44ce903c3",
		          "score": 29,
		          "maxPointsReason": "NONE"
		        }
		      ]
		    },
		    {
		      "raceNumber": "6",
		      "raceColumnName": "R6",
		      "competitors": [
		        {
		          "sailId": "GER 2098",
		          "competitorId": "bc883750-4b79-0137-d3a6-60a44ce903c3",
		          "score": 27,
		          "maxPointsReason": "NONE"
		        }
		      ]
		    }
		  ]
		}
		
Back to Web Service Overview