Getting Started
Read high-level overview of your game integration and what are minimal steps to start using OKLP API.

1. Integration High-Level Overview

This article contains a high-level overview of your Game integration with OKLP API.

High level overview - Sequence Diagram
  1. Registration. In order to integrate your Game API and Game Client with OKLP you need to provide some info about your Game API and Client. See "2. Game API and Client TODOs” below, Partner Requirements and Developer Config pages.
  2. Authentication. With developer-config.json on hands you'll be able to authenticate your Game API server or Game Client in OKLP API.
  3. Create Match flow.
    1. Players registered in OKLP service select a game, invite players in order to create a match.
    2. Once enough players have joined and paid entry fees (if any) the match is started. OKLP API will notify Game API about a new match has started by pushing match info updates.
  4. Play Match flow.
    1. Player’s Browser obtains a unique Game Client URL with a match-token. Game Client will be opened in the Players Browser. See how we direct players to the game.
    2. Game Client must verify the match-token by requesting match, user infofrom the OKLP API to make sure the match-token is not expired.
    3. Once the Game Client verifies the match-token users can start playing the match.
    4. After the match is finished, match results must be reported to the OKLP API.
    5. The OKLP API will store the results and payout winnings (if any).

2. Game API and Game Client TODOs

  1. You must provide the following information prior your game registration:
    1. Match info webhook URL. It will be used to notify your Game API about a new OKLP match started. 2.3.1 item below.
    2. Game client base URL. It will be used to redirect users to your Game Client once players start playing a match. 2.3.2 item below.
  2. Obtain developer-config.json from our support team once your game is registered. Store it securely, as it will be used to obtain OKLP API Authentication token.
  3. Implement:
    1. HTTP PUT {your-match-info-url} endpoint. OKLP sends requests to Game API. Should return HTTP 200 status. No retries are implemented at the moment. See Receiving push updates
    2. Game Client must verify requests with match-token when the match starts. See how we direct players to the game and match token info.
    3. Once the match is finished, report match results to the OKLP API. Your Game API must send a request to HTTP POST ${config.okletsplay_url}/api/games/v1/finish with appropriate body.

3. Next Steps

By following this short guide you’ll be able to start working with OKLP API and engage your players to play matches. Explore docs, to make sure you’ve implemented everything required for your game. Continue reading about developer config and authentication.

Each game may have individual peculiarities, if you have any questions regarding the integration contact us.

4. References

  1. OkLetsPlay Introduction
  2. Your Developer Config
  3. Authentication
  4. Receiving push updates
  5. How we direct players to the game
  6. Match Token
  7. Results Reporting