API Competition Details

Competition Details (GET)

The competition details webservice returns the JSON seen below and shows the full details of a competition.  It includes basic competition information as well as course and each players round details.

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

Example: http://golfscorecardpro.com:23556/v1/competition/D9D87508-8D5E-44E4-9749-36DD9F4DE080/1198f7524f835e7fc62a2dc7

An excellent way to visualise this data is using the online JSON editor .

 

Competition JSON

{
  "_id": "74370BD8-6993-4D27-B0C3-A74BF2C77B3F",
  "name": "Demo Cup",
  "team": 1,
  "type": "Best 3 Stableford",
  "hr": {
    "value": 1,
    "text": "Full"
  },
  "date": 20140503,
  "updates": 3,
  "ts": 1391900021623,
  "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 }
    ]
  },
  "rounds": [
    {
      "_id": "D975F2CB-395C-4E95-A0B7-EE69A92C776C",
      "players": [
        {
          "name": "Tom",
          "no": 1,
          "_id": "9E5CE276-B7E9-4CCB-AC8F-9F81493281A2",
          "shots": [
            {
              "no": 1,
              "shot": 3,
              "calc": {
                "strokes": 3,
                "points": 3,
                "score": -1,
                "running": -1
              }
            },
            {
              "no": 2,
              "shot": 4,
              "calc": {
                "strokes": 4,
                "points": 2,
                "score": 0,
                "running": -1
              }
            }
          ],
          "handicap": {
            "full": 5,
            "reduced": 5
          }
        },
        {
          "name": "Dick",
          "no": 2,
          "_id": "8C787C4F-642F-4D88-A570-0E39443CEC46",
          "shots": [
            {
              "no": 1,
              "shot": 5,
              "calc": {
                "strokes": 5,
                "points": 1,
                "score": 1,
                "running": 1
              }
            },
            {
              "no": 2,
              "shot": 6,
              "calc": {
                "strokes": 5,
                "points": 1,
                "score": 1,
                "running": 2
              }
            }
          ],
          "handicap": {
            "full": 10,
            "reduced": 10
          }
        },
        {
          "name": "Harry",
          "no": 3,
          "_id": "74C2B813-FD3D-4E66-BABA-7EBC9A3163EC",
          "shots": [
            {
              "no": 1,
              "shot": 5,
              "calc": {
                "strokes": 4,
                "points": 2,
                "score": 0,
                "running": "Par"
              }
            },
            {
              "no": 2,
              "shot": 6,
              "calc": {
                "strokes": 5,
                "points": 1,
                "score": 1,
                "running": 1
              }
            }
          ],
          "handicap": {
            "full": 15,
            "reduced": 15
          }
        },
        {
          "name": "Bob",
          "no": 4,
          "_id": "C5B3D30D-5427-4D59-9228-9BE2DD0A8866",
          "shots": [
            {
              "no": 1,
              "shot": 6,
              "calc": {
                "strokes": 5,
                "points": 1,
                "score": 1,
                "running": 1
              }
            },
            {
              "no": 2,
              "shot": 5,
              "calc": {
                "strokes": 4,
                "points": 2,
                "score": 0,
                "running": 1
              }
            }
          ],
          "handicap": {
            "full": 20,
            "reduced": 20
          }
        }
      ],
      "team": "Team A",
      "teamscores": {
        "scores": [
          {
            "no": 1,
            "points": 6,
            "strokes": 3,
            "score": -1,
            "running": -1
          },
          {
            "no": 2,
            "points": 5,
            "strokes": 4,
            "score": 0,
            "running": -1
          }
        ]
      },
      "twobbb": {
        "teams": [
          {
            "name": "Tom / Dick",
            "scores": [
              {
                "no": 1,
                "points": 3,
                "score": -1,
                "strokes": 3,
                "running": -1
              },
              {
                "no": 2,
                "points": 2,
                "score": 0,
                "strokes": 4,
                "running": -1
              }
            ]
          },
          {
            "name": "Harry / Bob",
            "scores": [
              {
                "no": 1,
                "points": 2,
                "score": 0,
                "strokes": 4,
                "running": "Par"
              },
              {
                "no": 2,
                "points": 2,
                "score": 0,
                "strokes": 4,
                "running": "Par"
              }
            ]
          }
        ]
      }
    }
  ],
  "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 }
  ]
}

Details

Competition GET 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: YYYYMMDD competition date.

    Line 11: Represents the number of updates.

    Line 12: The timestamp of the last update.  This is automatically updated when a change to the competition occurs.

  • Course Details

    Lines 13 – 36: An object that describes the competition course.

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

    Line 15: The competition display name.

    Lines 16 – 35: 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 229 -248: 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.

  • Individual Rounds / Results

    Lines 37 – 228: The rounds array holds all the information about each competition round.  In this example there is only one group made up of players: Tom, Dick, Harry and Bob playing a team competition with the imaginative team name of “Team A”.

    Lines 40 – 165: An array of the individual players in the round.

    Line 42: Players name.

    Line 43: The number the player appears in the scoring order.  Used to score 2BBB team.

    Line 44: _id is the unique guid to this player.

    Lines 67 – 70: The players handicap.  The full value is the actual players handicap.  The reduced is the players handicap after the handicap reduction has been applied.

    Lines 45 – 66: The array of the players shots and calculated scores.

    Lines 46 – 55: The shots and calculated scores for Tom on hole 1.

    Line 50: The calculated strokes for Tom using the stroke index of hole 1 (Line 17) and the handicap from Line 69.  The reduced handicap has been lowered based on the hr value (Line 7).  In this case Tom has a handicap of 5 gets no strokes on hole 1 with a stroke index of 14.

    Line 51: Using the strokes on Line 50 Tom is 1 under par for this hole and gets 3 stableford points.

    Line 52: Again using the strokes from Line 50 and the par for hole 1 (Line 17) Tom is -1 (1 under par) for this hole.

    Line 53: Based on the score from Line 52 and this being the first hole Tom has a running score of -1.  This running value continues as Tom pars the second hole.

  • Team Rounds / Results

    Line 166: Team name.

    Lines 167 – 184: An array of team scores with calculated scores for each hole.

    Line 171: Calculated team stableford points. Line 230 states that 3 scores will be used for hole 1. Tom, Dick and Harry contribute to the teams 6 points.

    Line 172: The stokes for the lowest scoring team member. In this case Tom with 3 strokes.

    Line 173: Score of -1 (1 under par) based on the strokes from Line 172.

    Line 174: Running score based on Line 173.

    Lines 185 – 226: This scoring block represents the 2 Ball Better Ball (2BBB) scoring. This method splits the round of 4 players into 2 teams of 2.

    Lines 187 – 205: Scores for team Tom / Dick.

    Line: 192: The highest stableford points selected from Tom (Line 51) and Dick’s (Line 82) points.

    Line 193: The lowest score between Tom (Line 52) and Dick (Line 83).

    Line 194: The lowest strokes for hole hole 1 between Tom (Line 50) and Dick (Line 81).

    Line 195: Running team score calculated from Line 193.