Update a session player
curl --request PATCH \
--url https://api.preprod.poolhouse.dev/api/session-players/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"has_cheated": true,
"name": "<string>",
"pool_table_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pool_table_public_id": "<string>",
"profile_picture_url": "<string>"
}
'import requests
url = "https://api.preprod.poolhouse.dev/api/session-players/{id}"
payload = {
"has_cheated": True,
"name": "<string>",
"pool_table_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pool_table_public_id": "<string>",
"profile_picture_url": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
has_cheated: true,
name: '<string>',
pool_table_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
pool_table_public_id: '<string>',
profile_picture_url: '<string>'
})
};
fetch('https://api.preprod.poolhouse.dev/api/session-players/{id}', 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.preprod.poolhouse.dev/api/session-players/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'has_cheated' => true,
'name' => '<string>',
'pool_table_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'pool_table_public_id' => '<string>',
'profile_picture_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.preprod.poolhouse.dev/api/session-players/{id}"
payload := strings.NewReader("{\n \"has_cheated\": true,\n \"name\": \"<string>\",\n \"pool_table_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pool_table_public_id\": \"<string>\",\n \"profile_picture_url\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.preprod.poolhouse.dev/api/session-players/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"has_cheated\": true,\n \"name\": \"<string>\",\n \"pool_table_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pool_table_public_id\": \"<string>\",\n \"profile_picture_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.preprod.poolhouse.dev/api/session-players/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"has_cheated\": true,\n \"name\": \"<string>\",\n \"pool_table_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pool_table_public_id\": \"<string>\",\n \"profile_picture_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"has_cheated": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_deleted": true,
"player_index": 123,
"pool_table": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"public_id": "<string>",
"table_alias": "<string>"
},
"pool_table_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ratings": {
"latest": {
"game_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rating": 123,
"shots_played": 123
},
"previous": {
"game_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rating": 123,
"shots_played": 123
}
},
"session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user": {
"acquisition_campaign": "<string>",
"acquisition_source": "<string>",
"auth0_user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"display_name": "<string>",
"email": "<string>",
"first_name": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_name": "<string>",
"marketing_opt_in": true,
"phone": "<string>",
"profile_picture_url": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"user_type": "primary",
"workos_user_id": "<string>"
}
},
"message": "<string>",
"status": "success"
}{
"data": "<unknown>",
"message": "<string>",
"status": "success"
}{
"data": "<unknown>",
"message": "<string>",
"status": "success"
}{
"data": "<unknown>",
"message": "<string>",
"status": "success"
}{
"data": "<unknown>",
"message": "<string>",
"status": "success"
}{
"data": "<unknown>",
"message": "<string>",
"status": "success"
}Session players
Update a session player
Changes only the fields that are sent. name and profile_picture_url are saved on the player’s
user, so they change wherever that user appears.
pool_table_id or pool_table_public_id moves the player to another of the booking’s tables
(pool_table_id wins when both are sent). On a booking with one table the player is always placed
on that table, whichever table is sent.
Who can call it: Manager, Host, Game Host, Venue Admin, Brand Admin or Organization Admin with access to the venue. Also the machine key.
PATCH
/
session-players
/
{id}
Update a session player
curl --request PATCH \
--url https://api.preprod.poolhouse.dev/api/session-players/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"has_cheated": true,
"name": "<string>",
"pool_table_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pool_table_public_id": "<string>",
"profile_picture_url": "<string>"
}
'import requests
url = "https://api.preprod.poolhouse.dev/api/session-players/{id}"
payload = {
"has_cheated": True,
"name": "<string>",
"pool_table_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pool_table_public_id": "<string>",
"profile_picture_url": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
has_cheated: true,
name: '<string>',
pool_table_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
pool_table_public_id: '<string>',
profile_picture_url: '<string>'
})
};
fetch('https://api.preprod.poolhouse.dev/api/session-players/{id}', 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.preprod.poolhouse.dev/api/session-players/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'has_cheated' => true,
'name' => '<string>',
'pool_table_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'pool_table_public_id' => '<string>',
'profile_picture_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.preprod.poolhouse.dev/api/session-players/{id}"
payload := strings.NewReader("{\n \"has_cheated\": true,\n \"name\": \"<string>\",\n \"pool_table_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pool_table_public_id\": \"<string>\",\n \"profile_picture_url\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.preprod.poolhouse.dev/api/session-players/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"has_cheated\": true,\n \"name\": \"<string>\",\n \"pool_table_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pool_table_public_id\": \"<string>\",\n \"profile_picture_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.preprod.poolhouse.dev/api/session-players/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"has_cheated\": true,\n \"name\": \"<string>\",\n \"pool_table_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pool_table_public_id\": \"<string>\",\n \"profile_picture_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"has_cheated": true,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_deleted": true,
"player_index": 123,
"pool_table": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"public_id": "<string>",
"table_alias": "<string>"
},
"pool_table_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ratings": {
"latest": {
"game_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rating": 123,
"shots_played": 123
},
"previous": {
"game_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"rating": 123,
"shots_played": 123
}
},
"session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user": {
"acquisition_campaign": "<string>",
"acquisition_source": "<string>",
"auth0_user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"display_name": "<string>",
"email": "<string>",
"first_name": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_name": "<string>",
"marketing_opt_in": true,
"phone": "<string>",
"profile_picture_url": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"user_type": "primary",
"workos_user_id": "<string>"
}
},
"message": "<string>",
"status": "success"
}{
"data": "<unknown>",
"message": "<string>",
"status": "success"
}{
"data": "<unknown>",
"message": "<string>",
"status": "success"
}{
"data": "<unknown>",
"message": "<string>",
"status": "success"
}{
"data": "<unknown>",
"message": "<string>",
"status": "success"
}{
"data": "<unknown>",
"message": "<string>",
"status": "success"
}Authorizations
Body
application/json
The fields to change
Response
The updated session player.