Skip to main content
PATCH
/
api
/
halls
/
{hall_id}
/
seats
Massive renewal of seats in the hall
curl --request PATCH \
  --url https://tandem.hlofiys.xyz/api/halls/{hall_id}/seats \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
[
  {
    "seat_id": 101,
    "seat_type_id": 2
  },
  {
    "seat_id": 102,
    "x_coordinate": 35.5,
    "y_coordinate": 20
  }
]
'
import requests

url = "https://tandem.hlofiys.xyz/api/halls/{hall_id}/seats"

payload = [
{
"seat_id": 101,
"seat_type_id": 2
},
{
"seat_id": 102,
"x_coordinate": 35.5,
"y_coordinate": 20
}
]
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([
{seat_id: 101, seat_type_id: 2},
{seat_id: 102, x_coordinate: 35.5, y_coordinate: 20}
])
};

fetch('https://tandem.hlofiys.xyz/api/halls/{hall_id}/seats', 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://tandem.hlofiys.xyz/api/halls/{hall_id}/seats",
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([
[
'seat_id' => 101,
'seat_type_id' => 2
],
[
'seat_id' => 102,
'x_coordinate' => 35.5,
'y_coordinate' => 20
]
]),
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://tandem.hlofiys.xyz/api/halls/{hall_id}/seats"

payload := strings.NewReader("[\n {\n \"seat_id\": 101,\n \"seat_type_id\": 2\n },\n {\n \"seat_id\": 102,\n \"x_coordinate\": 35.5,\n \"y_coordinate\": 20\n }\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://tandem.hlofiys.xyz/api/halls/{hall_id}/seats")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"seat_id\": 101,\n \"seat_type_id\": 2\n },\n {\n \"seat_id\": 102,\n \"x_coordinate\": 35.5,\n \"y_coordinate\": 20\n }\n]")
.asString();
require 'uri'
require 'net/http'

url = URI("https://tandem.hlofiys.xyz/api/halls/{hall_id}/seats")

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 {\n \"seat_id\": 101,\n \"seat_type_id\": 2\n },\n {\n \"seat_id\": 102,\n \"x_coordinate\": 35.5,\n \"y_coordinate\": 20\n }\n]"

response = http.request(request)
puts response.read_body
[
  {
    "seat_id": 123,
    "row_label": "12",
    "seat_label": "7",
    "x_coordinate": 0,
    "y_coordinate": 0,
    "seat_type_id": 123,
    "hall_id": 123
  }
]
{
"message": "Validation failed",
"errors": {
"seats[0].seat_id": "The seat_id field is required.",
"seats[2].x_coordinate": "The x_coordinate cannot be negative."
}
}
{
"message": "<string>"
}
{
"message": "<string>"
}
{
"message": "<string>"
}
{
"message": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

hall_id
integer<int64>
required

Body

application/json
seat_id
integer<int64>

Unique seat ID

row_label
string

Row label (e.g. '1', 'A', 'Parterre')

Example:

"12"

seat_label
string

Place label in a row (for example, '5', '10', 'VIP 1')

Example:

"7"

x_coordinate
number<double>
default:0

X coordinate to display on the diagram

y_coordinate
number<double>
default:0

Y coordinate to display on the diagram

seat_type_id
integer<int64>

Unique seat type ID

Response

Seats have been successfully updated. An array of updated objects is returned

seat_id
integer<int64>
required

Unique seat ID

row_label
string
required

Row label (e.g. '1', 'A', 'Parterre')

Example:

"12"

seat_label
string
required

Place label in a row (for example, '5', '10', 'VIP 1')

Example:

"7"

x_coordinate
number<double>
default:0
required

X coordinate to display on the diagram

y_coordinate
number<double>
default:0
required

Y coordinate to display on the diagram

seat_type_id
integer<int64>
required

Unique seat type ID

hall_id
integer<int64>
required

Unique hall ID