API Competition Leaderboard

Leaderboard Details (GET)

The leaderboard details webservice returns the JSON seen below and shows the calculated competition leaderboard.  It includes all the information required to display the leaderboard.

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

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

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

 

Leaderboard JSON


{
  "_id": "74370BD8-6993-4D27-B0C3-A74BF2C77B3F",
  "ts": 1391900021623,
  "name": "Demo Cup",
  "course": "Woodbridge Heath",
  "updates": 3,
  "team": 1,
  "type": "Best 3 Stableford",
  "hr": {
    "value": 1,
    "text": "Full"
  },
  "scores": [
    {
      "player": "Tom",
      "team": "Team A",
      "holes": 2,
      "points": {
        "value": 5,
        "par": "under",
        "pos": 1,
        "order": 1
      },
      "scores": {
        "value": -1,
        "par": "under",
        "pos": 1,
        "order": 1
      }
    },
    {
      "player": "Harry",
      "team": "Team A",
      "holes": 2,
      "points": {
        "value": 3,
        "par": "over",
        "pos": 2,
        "order": 2
      },
      "scores": {
        "value": 1,
        "par": "over",
        "pos": 2,
        "order": 2
      }
    },
    {
      "player": "Bob",
      "team": "Team A",
      "holes": 2,
      "points": {
        "value": 3,
        "par": "over",
        "order": 3
      },
      "scores": {
        "value": 1,
        "par": "over",
        "order": 3
      }
    },
    {
      "player": "Dick",
      "team": "Team A",
      "holes": 2,
      "points": {
        "value": 2,
        "par": "over",
        "pos": 4,
        "order": 4
      },
      "scores": {
        "value": 2,
        "par": "over",
        "pos": 4,
        "order": 4
      }
    }
  ],
  "teamscores": [
    {
      "team": "Team A",
      "holes": 2,
      "points": {
        "value": 11,
        "pos": 1,
        "order": 1,
        "par": "over"
      },
      "scores": {
        "value": -1,
        "par": "under",
        "pos": 1,
        "order": 1
      }
    }
  ],
  "twobbbscores": [
    {
      "team": "Tom / Dick",
      "holes": 2,
      "points": {
        "value": 5,
        "pos": 1,
        "order": 1,
        "par": "under"
      },
      "scores": {
        "value": -1,
        "par": "under",
        "pos": 1,
        "order": 1
      }
    },
    {
      "team": "Harry / Bob",
      "holes": 2,
      "points": {
        "value": 4,
        "pos": 2,
        "order": 2,
        "par": "par"
      },
      "scores": {
        "value": 0,
        "par": "par",
        "pos": 2,
        "order": 2
      }
    }
  ]
}

Details

Leaderboard GET JSON has all of the information you require to display a full leaderboard and it contains the  following items:

  • Base Information

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

    Line 3: Timestamp of the last update.

    Line 4: The competitions display name.

    Line 5: the course name.

    Line 6: Represents the number of updates.

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

    Line 8: The type of competition scoring.

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

  • Individual Scores / Results

    Lines 13 – 80: An array of individual scores, one for each player.

    Line 14 – 30: The results for player Tom.

    Line 15: The players name.

    Line 16: The players team name.

    Line 17: The number of holes played.

     

    Line 18 – 23: Stableford scoring.

    Line 19: Stableford points total after 2 holes.

    Line 20: Indicator showing if the player is currently under, over or on par.

    Line 21: Position on the leaderboard.  Blank if the same as the player above them.

    Line 22: The order they are on the leaderboard.  Tom is currently in first place.

     

    Line 24 – 28: Stroke scoring.

    Line 25: Stroke score total after 2 holes.

    Line 26: Indicator showing if the player is currently under, over or on par.

    Line 27: Position on the leaderboard.  Blank if the same as the player above them.

    Line 28: The order they are on the leaderboard.  Tom is currently in first place.

  • Team Scores / Results

    Line 81 – 90: An array of team scores, one for each team. In this example there is only one team.

    Line 83: The team name.

    Line 84: The number of holes played.

     

    Line 85 – 90: Stableford scoring.

    Line 86: Stableford points total after 2 holes.

    Line 87: Position on the leaderboard.  Blank if the same as the team above them.

    Line 88: The order they are on the leaderboard.

    Line 89: Indicator showing if the team is currently under, over or on par.

     

    Line 91 – 96: Stroke scoring.

    Line 92: Stroke score total after 2 holes.

    Line 93: Indicator showing if the team is currently under, over or on par.

    Line 94: Position on the leaderboard.  Blank if the same as the team above them.

    Line 95: The order they are on the leaderboard.

  • 2BBB Team Scores / Results

    Line 99 – 132: An array of 2 ball better ball team scores, one for each team of 2 players. In this example there 2 teams.

    Line 101: The team name.

    Line 102: The number of holes played.

     

    Line 103 – 108: Stableford scoring.

    Line 104: Stableford points total after 2 holes.

    Line 105: Position on the leaderboard.  Blank if the same as the team above them.

    Line 106: The order they are on the leaderboard.

    Line 107: Indicator showing if the team is currently under, over or on par.

     

    Line 109 – 115: Stroke scoring.

    Line 110: Stroke score total after 2 holes.

    Line 111: Indicator showing if the team is currently under, over or on par.

    Line 112: Position on the leaderboard.  Blank if the same as the team above them.

    Line 113: The order they are on the leaderboard.