Varje rutt, i sin helhet
Så anropar du det
Varje rutt är en GET, svarar med JSON och kräver en bearer-token — din appsession eller en personlig åtkomsttoken från Profil → API-åtkomst. Bas-URL:en är densamma för alla.
curl -H "Authorization: Bearer <token>" https://backend.goffy.app/api/me
curl -H "Authorization: Bearer <token>" -o goffy-export.json https://backend.goffy.app/api/me/exportRutter
En rond eller tour du varit med i kommer tillbaka så som appen visar den för dig, de andra spelarna inkluderade. En rond du inte spelat svarar 404, precis som en som inte finns.
/api/meYour profile
Account fields and the handicap held on your player record.
Returns MeProfile
userIdstring (uuid) — The account id; the same value as the token subject.playerIdstring (uuid) · optional — The player id every round, score and statistic is keyed by. Null until a player record exists.usernamestring — Sign-in name.displayNamestring — Name shown to other players.fullNamestring — Full name as entered on the profile.emailstring · optional — Contact email, when one is set.golfIdstring · optional — National golf id, normalised (no separators), when one is set.distanceUnitstring — Preferred distance unit: `metric` or `imperial`. Stored values are always metres.createdAtstring (date-time) — When the account was created.homeClubsarray of MeHomeClub — Home clubs, primary first when one is marked.handicapIndexnumber (double) · optional — Current handicap index, when one is recorded.handicapDatestring (date) · optional — The date the handicap index was last set.genderstring · optional — Gender as chosen on the player record, when set.
Errors: 401, 404, 502
/api/me/exportDownload everything
Your profile, tours, every round with your own scorecard lines, and all-time statistics as one JSON file. Limited to two downloads per minute.
Returns MeExport
exportedAtstring (date-time) — When the export was produced.profileMeProfiletoursarray of MeTour — Every tour the user is a member of, finished ones included.roundsarray of MeRoundDetail — Every round the user has played, with their own scorecard lines.statisticsMeStatistics
Errors: 401, 404, 429, 502
/api/me/roundsYour rounds
Every round you have played, newest first, with your totals in each.
Returns array of MeRoundSummary
roundIdstring (uuid) — Round id; use it with the round detail route.tourIdstring (uuid) — The tour the round belongs to.tourNamestring — Tour name.courseNamestring — Course name.statusstring — Round status: `open`, `playing`, `finished` or `cancelled`.playDatestring (date) · optional — Calendar date of play, when the round has one.playedAtUtcstring (date-time) — When the round was played, UTC.holesScoredinteger (int32) — Holes with a score.grossStrokesinteger (int32) — Total gross strokes over the scored holes.toParinteger (int32) — Gross strokes relative to par over the scored holes.meritPointsnumber (double) — Merit points earned in this round across its games.positioninteger (int32) · optional — Finishing position in the field; null when the round has no leaderboard yet.fieldSizeinteger (int32) — Number of players in the round.
Errors: 401, 404, 502
/api/me/rounds/{roundId}One of your rounds
The round as the app shows it to you: who played, every player's scorecard lines, hole events and scores, the game scores and the leaderboard. A round you did not play is a 404.
Parameters
roundIdpath · string (uuid) · required
Returns MeRoundDetail
roundMeRoundplayersarray of MePlayer — Everyone who played the round, the caller included, by id and display name.holeEntriesarray of MeHoleEntry — Scorecard lines for every player, one per scored hole. Keyed by `playerId`.holeEventsarray of MeHoleEvent — Hole events for every player.scoresarray of MeHoleScore — Stored gross scores for every player.gameScoresarray of MeGameScore — Each game's score points, per player.leaderboardarray of MeRoundStanding — The round leaderboard: game points per player, with the per-game breakdown.
Errors: 401, 404, 502
/api/me/statisticsYour statistics
Rounds, tours, games, trophies and scoring trends for one calendar year, or all time when no year is given.
Parameters
yearquery · integer (int32)
Returns MeStatistics
playerIdstring (uuid) — The caller's player id.yearinteger (int32) · optional — Calendar year the numbers cover, or null for all time.availableYearsarray — Years the user has rounds in, newest first.overviewMeStatisticsOverviewactiveToursarray of MeStatisticsTour — Tours the user is in that have not finished.trophiesMeStatisticsTrophiesgamesarray of MeStatisticsGame — Game types played in the period, with wins.recentRoundsarray of MeRoundSummary — The most recent rounds in the period.scoringMeStatisticsScoring
Errors: 401, 404, 502
/api/me/toursYour tours
Every tour you are a member of, hidden and finished ones included, each with the players in it.
Returns array of MeTour
idstring (uuid) — Tour id.tourNamestring · optional — Tour name, when one was given.statusstring — Tour status: `active`, `finished` or `archived`.isHiddenboolean — True when the user hid the tour from their own tour list.unfinishedRoundCountinteger (int32) — Rounds in the tour that have not finished.createdAtstring (date-time) — When the tour was created.playerCountinteger (int32) — How many players are in the tour, the caller included.playersarray of MePlayer — The players in the tour, the caller included, by id and display name.
Errors: 401, 404, 502
/api/me/tours/{tourId}One of your tours
The tour, the players in it, and the merit standings. A tour you are not in is a 404.
Parameters
tourIdpath · string (uuid) · required
Returns MeTourDetail
tourMeTourleaderboardarray of MeTourStanding — The merit standings, highest first. Empty until a round has been scored.
Errors: 401, 404, 502
Samma endpoints, från en klient
Varje endpoint ovan så som de genererade klienterna skriver den. Klienterna genereras från samma kontrakt, så varje anrop och varje fält kommer med beskrivningen du ser här: JSDoc i TypeScript, XML-summaries i C#, kommentarer på Python-modellerna. Editorn visar dem, så du behöver inte ha den här sidan uppe.
TypeScript
const goffy = createGoffyClient(process.env.GOFFY_TOKEN);
// Your profile
await goffy.api.me.get();
// Download everything
await goffy.api.me.exportEscaped.get();
// Your rounds
await goffy.api.me.rounds.get();
// One of your rounds
await goffy.api.me.rounds.byRoundId(roundId).get();
// Your statistics
await goffy.api.me.statistics.get();
// Your tours
await goffy.api.me.tours.get();
// One of your tours
await goffy.api.me.tours.byTourId(tourId).get();C#
var goffy = GoffyUserDataClientFactory.Create(token);
// Your profile
await goffy.Api.Me.GetAsync();
// Download everything
await goffy.Api.Me.Export.GetAsync();
// Your rounds
await goffy.Api.Me.Rounds.GetAsync();
// One of your rounds
await goffy.Api.Me.Rounds[roundId].GetAsync();
// Your statistics
await goffy.Api.Me.Statistics.GetAsync();
// Your tours
await goffy.Api.Me.Tours.GetAsync();
// One of your tours
await goffy.Api.Me.Tours[tourId].GetAsync();Python
goffy = create_client(token)
# Your profile
await goffy.api.me.get()
# Download everything
await goffy.api.me.export.get()
# Your rounds
await goffy.api.me.rounds.get()
# One of your rounds
await goffy.api.me.rounds.by_round_id(round_id).get()
# Your statistics
await goffy.api.me.statistics.get()
# Your tours
await goffy.api.me.tours.get()
# One of your tours
await goffy.api.me.tours.by_tour_id(tour_id).get()Installationsraderna för alla tre finns i guiden.