SAP Sailing Analytics Webservices API Version 1.0

URL: /api/v1/coursetemplates

Description:

The service creates a new course template.


Webservice Type: REST
Input format: Json
Output format: Json
Mandatory parameters: name: the name to set for the course template
allMarkTemplates: A set of all mark templates being part of the course template. Any mark template being part of at least one waypoint must be included. Additional mark templates that are not part of the waypoint sequence may be included as spare marks. For each entry, the following properties can be defined:
  • id (required): The UUID of the existing mark template
  • associatedRoleId (optional): For mark templates that are used in the waypoint sequence, an optional but unique role may be specified by its ID.
waypoints: An ordered sequence of waypoints that form the layout of the course template. For each waypoint, the following properties can be specified:
  • passingInstruction (required): For single mark waypoints, this can be one of [None, Port, Starboard, Single_Unknown, FixedBearing]. For mark pairs, this can be one of [None, Gate, Line, Offset].
  • markTemplateIds (required): List of UUIDs of the relevant mark templates. May specify one or two mark templates.
  • controlPointName (depends): For mark pairs this specifies the control point name. For single mark waypoints this is not used.
Optional parameters: optionalImageURL: URL pointing to the desired course template image
optionalRepeatablePart: JSON object that if given defines the part of the sequence that can be repeated in lap. The following properties must be given:
  • zeroBasedIndexOfRepeatablePartStart (required): offset of the first waypoint to include in the repeatable part. Must not be out of range for 0 <= i < count(waypoints).
  • zeroBasedIndexOfRepeatablePartEnd (required): offset of the first waypoint that comes after the repeatable part. Must not be out of range for 1 <= i <= count(waypoints) and must be > zeroBasedIndexOfRepeatablePartStart.
tags: An set of String tags
Request method: POST
Example: http://www.sapsailing.com/sailingserver/api/v1/coursetemplates
Example payload:
{
    "name": "my-special-course-template",
    "optionalImageURL": "http:\/\/www.sapsailing.com\/my-course-image.jpeg",
    "allMarkTemplates": [
        {
            "id": "9e6061d1-9217-4624-b464-8e2749d6e1c8",
            "associatedRole": "Startboat"
        },
        {
            "id": "e881e64b-8bdd-46af-be83-062ac6befd68",
            "associatedRole": "Pinend"
        },
        {
            "id": "46186c8e-335e-4c90-8b2d-7cd5ca6d304c",
            "associatedRole": "1"
        },
        {
            "id": "c29bdc51-451c-41a1-8d79-4fc986178e2b",
            "associatedRole": "4p"
        },
        {
            "id": "def5bd01-3681-4550-8648-894c12ed7d50",
            "associatedRole": "4s"
        },
        {
            "id": "73cc7728-b931-4ab1-88a1-684871f27faa"
        }
    ],
    "waypoints": [
        {
            "controlPointName": "Start\/End",
            "passingInstruction": "Line",
            "markTemplateIds": [
                "9e6061d1-9217-4624-b464-8e2749d6e1c8",
                "e881e64b-8bdd-46af-be83-062ac6befd68"
            ]
        },
        {
            "controlPointName": null,
            "passingInstruction": "Port",
            "markTemplateIds": [
                "46186c8e-335e-4c90-8b2d-7cd5ca6d304c"
            ]
        },
        {
            "controlPointName": null,
            "passingInstruction": "Gate",
            "markTemplateIds": [
                "def5bd01-3681-4550-8648-894c12ed7d50",
                "c29bdc51-451c-41a1-8d79-4fc986178e2b"
            ]
        },
        {
            "controlPointName": null,
            "passingInstruction": "Port",
            "markTemplateIds": [
                "46186c8e-335e-4c90-8b2d-7cd5ca6d304c"
            ]
        },
        {
            "controlPointName": "Start\/End",
            "passingInstruction": "Line",
            "markTemplateIds": [
                "9e6061d1-9217-4624-b464-8e2749d6e1c8",
                "e881e64b-8bdd-46af-be83-062ac6befd68"
            ]
        }
    ],
    "optionalRepeatablePart": {
        "zeroBasedIndexOfRepeatablePartStart": 1,
        "zeroBasedIndexOfRepeatablePartEnd": 3
    },
    "tags": ["tag1", "tag2"]
}
Back to Web Service Overview