Once the match has been setup we need to redirect the user to your game so that they can play their match; for this to happen we expect a game to provide us with their launch URLs, with the match-token
parameter being optional, such as:
Games that have their own authentication system can rely on it coupled with our platform linking to identify users when they join a game, however a game that does not have its own user identification and relies on OkLetsPlay user ids must have a way to identify a player joining their game, which is why we send the optional match-token
when required. Using that token a game can request that information from OkLetsPlay's backend.
curl \
-X POST \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer ${XXX-secret-jwt}' \
-d '{
"token": "${match-token}"
}' \
${config.okletsplay_url}/api/game/v1/token-info
token
stringThe token received as parameter when the game was launched{
"match_id": "600f369851f450dd3ecb0035",
"user_id": "0376d27d-4b0e-4286-9dd9-f9f7528689bb",
"match_status": "live",
"submissions_total": 1,
"submissions_left": 0
}
match_id
stringThe unique id for this match.user_id
stringParticipant of this match identified by match-token.match_status
stringA status of match or tournament.submissions_total
numberTotal attempts that a participant can submit a score.submissions_left
numberNumber of attempts left that a participant can submit a score.match_status
can be used to identify the status of a match. If it is not 'live'
(for matches and tournaments) or 'pending'
(for tournaments) it makes sense to let a participant know that the game activity by the match-token
is not actual and block a participant from playing a game.
submissions_left
can be used to identify how many attempts a participant has to submit a score. The value is initially set by tournament's "Max Submissions" setting. If the value is 0
then no attempts left and subsequent attempts will not be accepted by the OKLP API. If it is > 0
then player has submissions_left
number of attempts. Value of -1
means that a participant has unlimited attempts to submit a score. However, tournaments have "Max Ranked Submissions" setting, which identifies how many submissions will be counted for a participant's team place on leaderboard.
submissions_total
can be used to represent a participant how many total attempts he has to submit a score. As submissions_left
, the value of-1
means unlimited attempts. The value corresponds to tournament's "Max Submissions" setting.