🔐API Endpoints
Endpoints marked with the Required
tag must be integrated into your resource to ensure proper compatibility.
Recurring
Required: Periodic Server Update
POST
https://staffwatch.app/api/updateServer
Sends up-to-date information to StaffWatch regarding the players on the server. In order to ensure that the information on the panel is up-to-date, we recommend this endpoint be executed every 5-10 seconds.
This endpoint also returns something referred to as the command queue (see below). When RCON commands fail (or when a user has RCON disabled), commands are sent to this queue and should be executed immediately as they are deleted once this endpoint is executed.
Request Body
Events
Required: Player Join Event
POST
https://staffwatch.app/api/playerJoin
This endpoint must be triggered every time a player attempts to join the server. It will add them to the player database if they are not already in it, update their player identifiers, and finally return a JSON object providing information regarding if they should be allowed to join the server.
Request Body
Provides information about player's join request. The canJoin
variable should be used to determine if the user is permitted to join the server, or their connection should be disconnected. The newPlayer
variable determines if this is a players first time being logged on the server. The banned
variable, and accompanying information, only appear if the player is currently banned from the server. The appealCode
can be used by the player on https://staffwatch.app/appeal to appeal the ban.
Permissions
Check User Staff Status
POST
https://staffwatch.app/api/isStaff
Checks if a player is registered as a staff member in the online panel. This function relies on Claiming a Player in order to work properly! This is automatically performed for staff actions such as commend/warn/kick/ban but this endpoint can be useful if you want to integrate your own commands such as teleport/summon/freeze/etc.
Request Body
Commands
Required: Remote Actions (commend/warn/kick/ban)
POST
https://staffwatch.app/api/remoteAction
Request Body
Report Player
POST
https://staffwatch.app/api/reportPlayer
Players can report other players in-game and these reports will be sent to the server dashboard for staff members to investigate. This endpoint is generally mapped to a /report
command in-game.
Request Body
Get Trust Score
POST
https://staffwatch.app/api/getTrust
Gets a players trust score, this could be used for a /trustscore
command but could also be used for many other actions. Value will be between 0-100 and is based off a variety of things including staff actions against the player, length of time on server, etc.
Request Body
Generate Player Profile Access Key
POST
https://staffwatch.app/api/generate-profile-access-key
Players can access their profile by visiting https://staffwatch.app/appeal and entering their access key. This endpoint generates a temporary access key a player can use to view their profile. Generally this would be used for a /profile
command in-game.
Request Body
Miscellaneous
Create In-Game Log
POST
https://staffwatch.app/api/log
Create a log that will be displayed in either Server Logs or Event Log depending on the name provided. Generally server logs include chat messages and commands, while event logs include deaths, player join and leave events, etc.
Request Body
Last updated