General REST API Integration Guide
Every App on HosteDay exposes standard JSON REST APIs, allowing you to connect any framework or programming language—such as React, Next.js, Vue, Nuxt, Android (Kotlin), iOS (Swift), React Native, Laravel/PHP, or Python—over standard HTTP.
1. Base URL Structure & Required Headers
All API requests are sent to your App's HTTPS domain:
https://{your-app}.hosteday.com/api/...
Standard Headers
Accept: application/json
Content-Type: application/json
X-Api-Token: YOUR_API_TOKEN
Authorization: Bearer YOUR_USER_TOKEN
Note:
X-Api-Tokenis required when API Protection is enabled, whileAuthorization: Bearer {token}is required for write operations (POST,PUT,PATCH,DELETE) and authenticated user endpoints.
2. Available Endpoints Reference
| Feature | Main Endpoints |
|---|---|
| Auth & Users | POST /api/auth/register, POST /api/auth/login, POST /api/auth/forgot-password, GET /api/user, POST /api/logout |
| Automatic CRUD Tables | GET /api/{table}, GET /api/{table}/{id}, POST /api/{table}, PUT/PATCH /api/{table}/{id}, DELETE /api/{table}/{id} |
| Files & Media | POST /api/file/upload (with automatic image compression), DELETE /api/file/delete |
| Push Notification Devices | GET /api/notifications/devices, POST /api/notifications/devices/register, POST /api/notifications/devices/unregister |
| Realtime Events | POST /api/realtime/events/public, POST /api/realtime/events/private, POST /api/realtime/events/presence, POST /api/broadcasting/auth-manual |
| Background Jobs | POST /api/jobs/dispatch |
3. Quick Examples Across Environments
React / Next.js / Vue / TypeScript (fetch)
const res = await fetch('https://my-app.hosteday.com/api/products?filters[status]=active', {
headers: {
'Accept': 'application/json',
'X-Api-Token': 'YOUR_API_TOKEN',
},
});
const { data } = await res.json();
Python (requests)
import requests
res = requests.post(
'https://my-app.hosteday.com/api/products',
headers={
'Accept': 'application/json',
'X-Api-Token': 'YOUR_API_TOKEN',
'Authorization': 'Bearer YOUR_USER_TOKEN',
},
json={'name': 'Smart Watch', 'price': 199.0},
)
print(res.json())
PHP / Laravel (Http Client)
$response = Http::withHeaders([
'X-Api-Token' => 'YOUR_API_TOKEN',
])->get('https://my-app.hosteday.com/api/products');
$items = $response->json('data.data');
4. Game Engines Example (Unity C# & Godot GDScript)
Connect Unity, Godot, and Unreal Engine games for player saves and leaderboards using X-Api-Token and Authorization: Bearer {token}:
Unity (UnityWebRequest)
var req = new UnityWebRequest("https://my-app.hosteday.com/api/scores", "POST");
byte[] body = System.Text.Encoding.UTF8.GetBytes("{\"score\": 1500}");
req.uploadHandler = new UploadHandlerRaw(body);
req.downloadHandler = new DownloadHandlerBuffer();
req.SetRequestHeader("Content-Type", "application/json");
req.SetRequestHeader("Accept", "application/json");
req.SetRequestHeader("X-Api-Token", "YOUR_API_TOKEN");
req.SetRequestHeader("Authorization", "Bearer " + userToken);
yield return req.SendWebRequest();
Godot (HTTPRequest)
var headers = [
"Content-Type: application/json",
"Accept: application/json",
"X-Api-Token: YOUR_API_TOKEN",
"Authorization: Bearer " + user_token
]
var payload = JSON.stringify({"score": 1500})
$HTTPRequest.request("https://my-app.hosteday.com/api/scores", headers, HTTPClient.METHOD_POST, payload)