API Create New Competition

Create Competition (POST)

The create new competition webservice accepts the JSON seen below and represents a new competitions details.  It includes the base information like name, type and course.

URL: http://golfscorecardpro.com:23556/v1/competition/authorisation id
 

New Competition JSON


{
  "_id": "74370BD8-6993-4D27-B0C3-A74BF2C77B3F",
  "name": "Demo Cup",
  "team": 1,
  "type": "Best 3 Stableford",
  "hr" : {
    "value" : 1,
    "text" : "Full"
  },
  "updates": -1,
  "date": "20140503",
  "course": {
    "_id": "1422C64C-31F0-436A-86E1-5DDA3026A7BA",
    "name": "Woodbridge Heath",
    "holes": [
      { "no": 1, "par": 4, "si": 14 },
      { "no": 2, "par": 4, "si": 10 },
      { "no": 3, "par": 5, "si": 4  },
      { "no": 4, "par": 4, "si": 12 },
      { "no": 5, "par": 4, "si": 2 },
      { "no": 6, "par": 4, "si": 6 },
      { "no": 7, "par": 3, "si": 18 },
      { "no": 8, "par": 5, "si": 8 },
      { "no": 9, "par": 3, "si": 16 },
      { "no": 10, "par": 4, "si": 1 },
      { "no": 11, "par": 4, "si": 11 },
      { "no": 12, "par": 3, "si": 9 },
      { "no": 13, "par": 4, "si": 17 },
      { "no": 14, "par": 4, "si": 5 },
      { "no": 15, "par": 3, "si": 13 },
      { "no": 16, "par": 4, "si": 3 },
      { "no": 17, "par": 4, "si": 7 },
      { "no": 18, "par": 4, "si": 15 }
    ]
  },
  "scoring": [
    { "no": 1, "scores": 3 },
    { "no": 2, "scores": 3 },
    { "no": 3, "scores": 3 },
    { "no": 4, "scores": 3 },
    { "no": 5, "scores": 3 },
    { "no": 6, "scores": 3 },
    { "no": 7, "scores": 3 },
    { "no": 8, "scores": 3 },
    { "no": 9, "scores": 3 },
    { "no": 10, "scores": 3 },
    { "no": 11, "scores": 3 },
    { "no": 12, "scores": 3 },
    { "no": 13, "scores": 3 },
    { "no": 14, "scores": 3 },
    { "no": 15, "scores": 3 },
    { "no": 16, "scores": 3 },
    { "no": 17, "scores": 3 },
    { "no": 18, "scores": 3 }
  ],
  "rounds": []
}

Details

Competition POST JSON has the  following items:

  • Base Information

    Line 2: The “_id” is a guid unique to the competition.

    Line 3: The competitions display name.

    Line 4: “Team” flags team competitions, 1 = Team, 0 = Singles.

    Lines 6 – 9: This sections is for handicap reductions.  Full = 1, 7/8 = 0.875, 3/4 = 0.75

    Line 10: Represents the number of updates.

    Line 11: YYYYMMDD competition date.

  • Course Details

    Lines 12 – 35: An object that describes the competition course.

    Line 13: The “_id” is a guid unique to the course.

    Line 14: The competition display name.

    Lines 15 – 34: An array of objects that represent the course holes.  Each hole has a number (no) it’s par and a stroke index (si).

  • Scoring

    Line 5: “Type” describes the scoring method for the competition.  The current options are: Stableford, Stroke, Best 2 Stableford, Best 3 Stableford.

    Lines 36 -55: An array of objects that are used in team stableford competitions to indicate the number of scores used from each hole.  This example shows 3 scores are used for each hole.  This could be changed to vary the scores used on specific holes.

    Line 56: An empty array that will contain each individual rounds data populated as the scores are entered.