Skip to content

Custom OGS Online Leagues

GreenAsJade edited this page Apr 18, 2023 · 10 revisions

OGS provide a way for organisations to run their own "league" on OGS, with a separate rank for players in the league, calculated from league games.

It's is driven by an API that the organisation can use to register players and arrange matches.

Overview

  • The organisation notifies OGS of league members, providing their "membership id" and their starting league rank.
  • The organisation requests matches between nominated players, providing the player-ids and optionally details of the match.
    • OGS provides a unique link to be given to each of the players, which lets them join their match
    • OGS provides a different link, which spectators can use to join the game
  • When the players use their link, they arrive at a "lobby" page, where they can chat and decide when to start
    • They can also chat with spectators at this time
  • When both players indicate they are ready to start, the game commences (and they are taken to it)
  • The organisation can ask OGS about the status of matches at any time.
  • Optionally, OGS will hit a URL provided by the organisation, to tell them when each game finishes and what the result was

Setting up & Use

  1. Get an API key from OGS - you'll need to provide an "identifier" for your organisation
  2. Tell OGS about your members:
curl --location --request PUT 'https://beta.online-go.com/api/v1/online_league/member/crna_01' \
--header 'X-OGS-LEAGUE: Costa Rica National Association' \
--header 'X-OGS-LEAGUE-AUTH: Ge3Mqrf6JjDSYaf9ZcCc64' \
--header 'Content-Type: application/json' \
--header 'Cookie: csrftoken=Od0zZQiVhjLJ04Qc69w7jOljEU8TZMaBhyOTOQtVhI8ilaZl1vcGIe8QwYW6iZew' \
--data '{"rating": 2500}'