Skip to main content
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>"
}

Authorizations

api-key
string
header
required

Headers

x-player-id
string
required

Unique player identifier.

Path Parameters

config
string
required

Lobby configuration name or ID.

Response

Heartbeat recorded.

lastHeartbeat
string
required

ISO 8601 timestamp of this heartbeat.