Examples
Small, complete examples to copy and change. Replace the server id and keep your key in an environment variable called TECHNIFIED_KEY.
Look up a member’s Roblox account
Needs members.read. Useful for your own Discord bot.
async function robloxOf(discordUserId) {
const response = await fetch(
`https://api.technified.xyz/v1/guilds/YOUR_DISCORD_SERVER_ID/verification/members/${discordUserId}`,
{ headers: { Authorization: `Bearer ${process.env.TECHNIFIED_KEY}` } },
);
if (response.status === 404) return null; // not linked here
const member = await response.json();
return member.roblox; // { userId, username, displayName }
}Ban somebody from your own tool
Needs moderation.write. The actor credits the moderator who used your tool. The Idempotency-Key makes a retry safe.
import { randomUUID } from "node:crypto";
const response = await fetch(
"https://api.technified.xyz/v1/guilds/YOUR_DISCORD_SERVER_ID/moderation/punishments",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.TECHNIFIED_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": randomUUID(),
},
body: JSON.stringify({
platform: "roblox", // or "discord"
type: "ban", // ban, mute, warning or kick
targetId: "156", // the Roblox or Discord account id
reason: "Exploiting", // the person is told this
durationSeconds: 7 * 24 * 60 * 60, // null for permanent
actor: { label: "Lena", discordUserId: "700000000000000002" },
}),
},
);
if (!response.ok) {
const problem = await response.json();
throw new Error(`${problem.code}: ${problem.detail}`);
}
const { punishment } = await response.json();
console.log("Banned, reference", punishment.id);Lift a punishment
curl -X POST "https://api.technified.xyz/v1/guilds/YOUR_DISCORD_SERVER_ID/moderation/punishments/pun_01J9Z4T7C2Q8M3N5V6W7X8Y9Z0/revoke" \
-H "Authorization: Bearer $TECHNIFIED_KEY" \
-H "Content-Type: application/json" \
-d '{"reason":"Appeal accepted"}'List open tickets
Needs tickets.read. Follows nextCursor until every page is read.
async function openTickets() {
const all = [];
let cursor = null;
do {
const url = new URL("https://api.technified.xyz/v1/guilds/YOUR_DISCORD_SERVER_ID/tickets");
url.searchParams.set("state", "open");
url.searchParams.set("limit", "100");
if (cursor) url.searchParams.set("cursor", cursor);
const response = await fetch(url, {
headers: { Authorization: `Bearer ${process.env.TECHNIFIED_KEY}` },
});
const page = await response.json();
all.push(...page.items);
cursor = page.nextCursor;
} while (cursor);
return all;
}Announce something in every game server
Needs servers.broadcast. Every live server shows the message to its players.
curl -X POST "https://api.technified.xyz/v1/guilds/YOUR_DISCORD_SERVER_ID/servers/broadcast" \
-H "Authorization: Bearer $TECHNIFIED_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"command":{"type":"announce","message":"Event starts in 10 minutes!"}}'From a Roblox server script
For bans in your game, use the ready made game integration. If you still want to call the API yourself, do it only from a server Script, with HTTP requests switched on, and keep the key in ServerScriptService or ServerStorage, never anywhere a player can reach.
local HttpService = game:GetService("HttpService")
local KEY = "tfy_your_key_here" -- keep this script in ServerScriptService
local URL = "https://api.technified.xyz/v1/guilds/YOUR_DISCORD_SERVER_ID/moderation/status"
game.Players.PlayerAdded:Connect(function(player)
local ok, response = pcall(HttpService.RequestAsync, HttpService, {
Url = URL .. "?platform=roblox&targetId=" .. player.UserId,
Method = "GET",
Headers = { Authorization = "Bearer " .. KEY },
})
if not ok or not response.Success then
return -- never keep somebody out because the check failed
end
local status = HttpService:JSONDecode(response.Body)
if status.banned then
player:Kick("You are banned: " .. status.ban.reason)
end
end)Still stuck? Get help from the Technified team.