Mengambil metadata board beserta maksimal 100 entri peringkat teratas. Pengurutan otomatis mengikuti tipe board (timeMs ASC untuk TIME, bestScore DESC untuk HIGHSCORE/CLASSIC, rating DESC untuk LEAGUE/LEVELS).
POST/api/v1/boards/:slug/entriesAUTH: BEARER API KEY
Push Skor, Lap Time (ms), Liga & XP Levels
Mengirim pembaruan skor atau aktivitas pemain langsung dari skrip game. Mendukung Highscore (ambil nilai tertinggi), Classic (akumulasi), Time (lap tercepat dalam ms), League (delta rating + W/D/L), serta Levels (tambah XP dan hitung level otomatis).
Field
Tipe
Status
Keterangan
discordId
string
WAJIB
Discord User ID pemain. Jika belum ada di DB, user dibuat otomatis.
username
string (max 64)
Opsional
Nama tampilan pemain saat record dibuat pertama kali.
score
integer
Opsional
Dipakai untuk HIGHSCORE (best peak) atau CLASSIC (akumulatif).
timeMs
integer (>= 1)
Opsional
Dipakai untuk tipe TIME / Racing Speedrun (milidetik, makin kecil makin cepat).
ratingDelta
integer (-500..500)
Opsional
Perubahan poin untuk tipe LEAGUE / klasemen musiman.
outcome
"WIN" | "DRAW" | "LOSS"
Opsional
Menambah statistik Menang / Seri / Kalah entri board.
xpDelta
integer (1..50000)
Opsional
Tambahan XP untuk board tipe LEVELS; sekaligus memperbarui level user di guild.
// 404 Not Found
{
"error": "TOURNAMENT_NOT_FOUND"
}
POST/api/v1/tournaments/:slug/matchesAUTH: BEARER API KEY
Webhook Kirim Hasil Match Otomatis dari Game Server
Endpoint utama untuk integrasi game server (Roblox, FiveM, Minecraft, Valorant, Custom). Mendukung duel Head-to-Head maupun Multi-Lobby Racing/Battle Royale (hingga 100 peserta). Saat diterima, bot Discord langsung mem-broadcast pembaruan bracket PNG dan OBS Live Overlay via Redis.
Field
Tipe
Status
Keterangan
matchId
uuid
Opsional
Isi dengan UUID match jika ingin memperbarui match bracket yang sudah ada.
round
integer (1..32)
Opsional
Nomor ronde / heat turnamen (default: 1).
externalMatchRef
string (max 120)
Opsional
ID unik match di server game Anda untuk jejak audit.
Mengambil payload real-time pertandingan aktif dan top klasemen guild untuk scene OBS Browser Source (`active-match`, `scoreboard`, `live-bracket`) maupun widget website komunitas Anda.
Field
Tipe
Status
Keterangan
:guildId
path string
WAJIB
Discord Guild ID server turnamen.
:mode
"active-match" | "scoreboard" | "live-bracket"
WAJIB
Mode visualisasi broadcast target.
// GET /api/public/overlay/123456789012345678/active-match
// Juga tersedia:
// GET /api/public/tournaments/:slug
// GET /api/public/leaderboards
Template Modul Siap Pakai (Roblox, FiveM & Node.js)
Salin modul lengkap berikut ke proyek server game Anda untuk menghubungkan skor, lap time, dan hasil turnamen otomatis.
LUAU // HTTPSERVICE
Roblox Studio — Complete ModuleScript (ServerScriptService)
Membungkus autentikasi Bearer Key, pencatatan Highscore / Lap Time, dan laporan hasil turnamen dengan proteksi pcall agar server Roblox tidak crash saat jaringan lag.
Simpan sebagai ReplicatedStorage/NoSatuSDK (ModuleScript), panggil hanya dari Server Script.
local HttpService = game:GetService("HttpService")
local NoSatu = {}
NoSatu.BASE_URL = "https://nosatu.my.id"
NoSatu.API_KEY = "nst_live_your_api_key" -- Jangan simpan di LocalScript!
local function request(method, path, bodyTable)
local ok, response = pcall(function()
return HttpService:RequestAsync({
Url = NoSatu.BASE_URL .. path,
Method = method,
Headers = {
["Authorization"] = "Bearer " .. NoSatu.API_KEY,
["Content-Type"] = "application/json",
},
Body = bodyTable and HttpService:JSONEncode(bodyTable) or nil,
})
end)
if not ok then
warn("[NoSatu] HTTP error:", response)
return false, nil
end
local decoded = nil
pcall(function()
decoded = HttpService:JSONDecode(response.Body)
end)
return response.Success, decoded
end
function NoSatu.PushScore(boardSlug, discordId, username, score, timeMs)
return request("POST", "/api/v1/boards/" .. boardSlug .. "/entries", {
discordId = tostring(discordId),
username = username,
score = score,
timeMs = timeMs,
})
end
function NoSatu.PushMatchResult(tournamentSlug, gameSource, roundNum, participants)
return request("POST", "/api/v1/tournaments/" .. tournamentSlug .. "/matches", {
gameSource = gameSource or "ROBLOX",
round = roundNum or 1,
participants = participants,
})
end
return NoSatu
LUA // PERFORMHTTPREQUEST
FiveM Server — Complete Sync Script (server.lua)
Mengirim hasil balapan multi-pemain (placement, timeMs) ke turnamen NoSatu sekaligus mengupdate papan Time Trial secara otomatis.
Letakkan di resource server-side Anda dan pastikan API Key diambil dari server.cfg ConVar.
local API_URL = "https://nosatu.my.id"
local API_KEY = GetConvar("nosatu_api_key", "")
local function nosatuPost(path, payload, cb)
if API_KEY == "" then
print("^1[NoSatu] API key belum diset di server.cfg (set nosatu_api_key ...)^0")
return
end
PerformHttpRequest(
API_URL .. path,
function(statusCode, body)
if cb then cb(statusCode, body) end
end,
"POST",
json.encode(payload),
{
["Authorization"] = "Bearer " .. API_KEY,
["Content-Type"] = "application/json",
}
)
end
-- Panggil saat 1 heat/race turnamen selesai
exports("SyncRaceTournament", function(slug, raceId, driverRows)
nosatuPost("/api/v1/tournaments/" .. slug .. "/matches", {
gameSource = "FIVEM",
round = 1,
externalMatchRef = tostring(raceId),
participants = driverRows,
}, function(code, body)
print(("[NoSatu] Tournament sync HTTP %s: %s"):format(code, body))
end)
end)
TYPESCRIPT // FETCH
Node.js / TypeScript Client Wrapper (SDK Ready)
Client wrapper ringan tanpa dependensi tambahan dengan penanganan status HTTP 400/401/403/429.
Cocok untuk backend game custom, Discord bot tambahan, atau server Minecraft bridge.