Send a player heartbeat
curl --request POST \
--url https://api.computeflow.cloud/api/v3/lobbies/{config}/me/heartbeat \
--header 'api-key: <api-key>' \
--header 'x-player-id: <x-player-id>'import requests
url = "https://api.computeflow.cloud/api/v3/lobbies/{config}/me/heartbeat"
headers = {
"x-player-id": "<x-player-id>",
"api-key": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-player-id': '<x-player-id>', 'api-key': '<api-key>'}
};
fetch('https://api.computeflow.cloud/api/v3/lobbies/{config}/me/heartbeat', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.computeflow.cloud/api/v3/lobbies/{config}/me/heartbeat",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"api-key: <api-key>",
"x-player-id: <x-player-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.computeflow.cloud/api/v3/lobbies/{config}/me/heartbeat"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-player-id", "<x-player-id>")
req.Header.Add("api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.computeflow.cloud/api/v3/lobbies/{config}/me/heartbeat")
.header("x-player-id", "<x-player-id>")
.header("api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.computeflow.cloud/api/v3/lobbies/{config}/me/heartbeat")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-player-id"] = '<x-player-id>'
request["api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"lastHeartbeat": "<string>"
}{
"error": "<string>",
"status": 123,
"detail": "<string>"
}{
"error": "<string>",
"status": 123,
"detail": "<string>"
}Lobbies
Send a player heartbeat
Updates the caller’s lastHeartbeat timestamp. Only needed if the lobby config has heartbeat: true enabled — in that case, players whose heartbeat is older than heartbeatTimeout seconds are evicted by the lobby-sweep cron.
Use this for polling clients where the SSE connection (which acts as an implicit heartbeat) isn’t available. Send every few seconds (well under heartbeatTimeout).
POST
/
api
/
v3
/
lobbies
/
{config}
/
me
/
heartbeat
Send a player heartbeat
curl --request POST \
--url https://api.computeflow.cloud/api/v3/lobbies/{config}/me/heartbeat \
--header 'api-key: <api-key>' \
--header 'x-player-id: <x-player-id>'import requests
url = "https://api.computeflow.cloud/api/v3/lobbies/{config}/me/heartbeat"
headers = {
"x-player-id": "<x-player-id>",
"api-key": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-player-id': '<x-player-id>', 'api-key': '<api-key>'}
};
fetch('https://api.computeflow.cloud/api/v3/lobbies/{config}/me/heartbeat', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.computeflow.cloud/api/v3/lobbies/{config}/me/heartbeat",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"api-key: <api-key>",
"x-player-id: <x-player-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.computeflow.cloud/api/v3/lobbies/{config}/me/heartbeat"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-player-id", "<x-player-id>")
req.Header.Add("api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.computeflow.cloud/api/v3/lobbies/{config}/me/heartbeat")
.header("x-player-id", "<x-player-id>")
.header("api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.computeflow.cloud/api/v3/lobbies/{config}/me/heartbeat")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-player-id"] = '<x-player-id>'
request["api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"lastHeartbeat": "<string>"
}{
"error": "<string>",
"status": 123,
"detail": "<string>"
}{
"error": "<string>",
"status": 123,
"detail": "<string>"
}⌘I