Book seats for an anonymous user
curl --request POST \
--url https://tandem.hlofiys.xyz/api/bookings/anonymous \
--header 'Content-Type: application/json' \
--data '
{
"email": "[email protected]",
"phone_number": "+375291234567",
"event_id": 123,
"seat_ids": [
101,
102
]
}
'import requests
url = "https://tandem.hlofiys.xyz/api/bookings/anonymous"
payload = {
"email": "[email protected]",
"phone_number": "+375291234567",
"event_id": 123,
"seat_ids": [101, 102]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
email: '[email protected]',
phone_number: '+375291234567',
event_id: 123,
seat_ids: [101, 102]
})
};
fetch('https://tandem.hlofiys.xyz/api/bookings/anonymous', 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/bookings/anonymous",
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([
'email' => '[email protected]',
'phone_number' => '+375291234567',
'event_id' => 123,
'seat_ids' => [
101,
102
]
]),
CURLOPT_HTTPHEADER => [
"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/bookings/anonymous"
payload := strings.NewReader("{\n \"email\": \"[email protected]\",\n \"phone_number\": \"+375291234567\",\n \"event_id\": 123,\n \"seat_ids\": [\n 101,\n 102\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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/bookings/anonymous")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"[email protected]\",\n \"phone_number\": \"+375291234567\",\n \"event_id\": 123,\n \"seat_ids\": [\n 101,\n 102\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tandem.hlofiys.xyz/api/bookings/anonymous")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"[email protected]\",\n \"phone_number\": \"+375291234567\",\n \"event_id\": 123,\n \"seat_ids\": [\n 101,\n 102\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"booking_id": 123,
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"event_id": 123,
"seat_id": 123,
"is_paid": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]{
"message": "Validation failed",
"errors": {
"name": "The name field is required.",
"price": "The price must be a valid number.",
"hall_id": "A valid hall_id is required."
}
}{
"message": "<string>"
}{
"message": "<string>"
}Bookings
Book seats for an anonymous user
Allows an unregistered user to book seats. The system will automatically create a new user account if one does not exist for the provided email and send an activation link to that email. If an account already exists, an error is returned prompting the user to log in.
POST
/
api
/
bookings
/
anonymous
Book seats for an anonymous user
curl --request POST \
--url https://tandem.hlofiys.xyz/api/bookings/anonymous \
--header 'Content-Type: application/json' \
--data '
{
"email": "[email protected]",
"phone_number": "+375291234567",
"event_id": 123,
"seat_ids": [
101,
102
]
}
'import requests
url = "https://tandem.hlofiys.xyz/api/bookings/anonymous"
payload = {
"email": "[email protected]",
"phone_number": "+375291234567",
"event_id": 123,
"seat_ids": [101, 102]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
email: '[email protected]',
phone_number: '+375291234567',
event_id: 123,
seat_ids: [101, 102]
})
};
fetch('https://tandem.hlofiys.xyz/api/bookings/anonymous', 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/bookings/anonymous",
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([
'email' => '[email protected]',
'phone_number' => '+375291234567',
'event_id' => 123,
'seat_ids' => [
101,
102
]
]),
CURLOPT_HTTPHEADER => [
"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/bookings/anonymous"
payload := strings.NewReader("{\n \"email\": \"[email protected]\",\n \"phone_number\": \"+375291234567\",\n \"event_id\": 123,\n \"seat_ids\": [\n 101,\n 102\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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/bookings/anonymous")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"[email protected]\",\n \"phone_number\": \"+375291234567\",\n \"event_id\": 123,\n \"seat_ids\": [\n 101,\n 102\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tandem.hlofiys.xyz/api/bookings/anonymous")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"[email protected]\",\n \"phone_number\": \"+375291234567\",\n \"event_id\": 123,\n \"seat_ids\": [\n 101,\n 102\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"booking_id": 123,
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"event_id": 123,
"seat_id": 123,
"is_paid": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]{
"message": "Validation failed",
"errors": {
"name": "The name field is required.",
"price": "The price must be a valid number.",
"hall_id": "A valid hall_id is required."
}
}{
"message": "<string>"
}{
"message": "<string>"
}Body
application/json
The user's email address. An account will be created if it doesn't exist.
The user's phone number, preferably in international E.164 format.
Example:
"+375291234567"
The unique identifier for the event.
An array of unique identifiers for the seats to be booked.
Example:
[101, 102]
Response
Booking successful. An account has been created and an activation link has been sent to the provided email.