Skip to main content
POST
/
api
/
halls
/
{hall_id}
/
seats
Mass creation of seats in hall
curl --request POST \
  --url https://tandem.hlofiys.xyz/api/halls/{hall_id}/seats \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
[
  {
    "row_label": "12",
    "seat_label": "7",
    "x_coordinate": 0,
    "y_coordinate": 0,
    "seat_type_id": 123
  }
]
'
import requests

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

payload = [
{
"row_label": "12",
"seat_label": "7",
"x_coordinate": 0,
"y_coordinate": 0,
"seat_type_id": 123
}
]
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
row_label: '12',
seat_label: '7',
x_coordinate: 0,
y_coordinate: 0,
seat_type_id: 123
}
])
};

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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
[
'row_label' => '12',
'seat_label' => '7',
'x_coordinate' => 0,
'y_coordinate' => 0,
'seat_type_id' => 123
]
]),
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 \"row_label\": \"12\",\n \"seat_label\": \"7\",\n \"x_coordinate\": 0,\n \"y_coordinate\": 0,\n \"seat_type_id\": 123\n }\n]")

req, _ := http.NewRequest("POST", 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.post("https://tandem.hlofiys.xyz/api/halls/{hall_id}/seats")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"row_label\": \"12\",\n \"seat_label\": \"7\",\n \"x_coordinate\": 0,\n \"y_coordinate\": 0,\n \"seat_type_id\": 123\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::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"row_label\": \"12\",\n \"seat_label\": \"7\",\n \"x_coordinate\": 0,\n \"y_coordinate\": 0,\n \"seat_type_id\": 123\n }\n]"

response = http.request(request)
puts response.read_body
[
  {
    "seat_id": 150,
    "row_label": "A",
    "seat_label": "1",
    "x_coordinate": 10.5,
    "y_coordinate": 20,
    "seat_type_id": 1,
    "hall_id": 1
  },
  {
    "seat_id": 151,
    "row_label": "A",
    "seat_label": "2",
    "x_coordinate": 25.5,
    "y_coordinate": 20,
    "seat_type_id": 1,
    "hall_id": 1
  }
]
{
"message": "Validation failed",
"errors": {
"seats[1].row_label": "The row_label field is required.",
"seats[2].seat_type_id": "A valid seat_type_id is required."
}
}
{
"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
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

Response

Seat have been successfully created. An array of created seat objects with their new IDs 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