Skip to content

Instantly share code, notes, and snippets.

@DaltonWebDev
Created May 16, 2018 12:53
Show Gist options
  • Save DaltonWebDev/9c69ca4bac8cf7006a0278832324e729 to your computer and use it in GitHub Desktop.
Save DaltonWebDev/9c69ca4bac8cf7006a0278832324e729 to your computer and use it in GitHub Desktop.

Registration

API Endpoint Method Authentication
https://bedrockbans.com/api/register.php GET No

This API doesn't accept any parameters.

Example Output

{
    "error": false,
    "data": {
        "server-name": "16 character alphanumeric string in all caps.",
        "access-token": "32 character alphanumeric string in mixed case."
    }
}

Make sure you save your server name and access token or you'll be unable to communicate with APIs that require authentication.

Ban

API Endpoint Method Authentication
https://bedrockbans.com/api/ban.php POST Yes

Parameters

Parameter About
server-name The 16 character string generated for you by registration endpoint.
access-token The 32 character string generated for you by registration endpoint.
banned-xuid The XUID of the player being banned.
banned-gamertag The gamertag of the player being banned.
banned-ip The IP address of the player being banned.
banner-xuid The XUID of the player who's banning somebody.
banner-gamertag The gamertag of the player who's banning somebody.
banner-ip The IP address of the player who's banning somebody.
ban-reason The reason for banning this player.

Errors

Error About
INCOMPLETE_API_REQUEST Some or all parameters are missing.
SERVER_NOT_REGISTERED This server isn't registered.
INVALID_ACCESS_TOKEN The access token is incorrect.
INVALID_BAN_PERMISSIONS You don't have permission to ban players.
INVALID_BANNED_XUID The XUID format is incorrect.
INVALID_BANNED_IP This isn't an IP address. Must be IPv4 or IPv6 format.
PLAYER_ALREADY_BANNED This player has already been banned.
INVALID_BANNER_XUID The XUID format is incorrect.
INVALID_SELF_BAN You can't ban yourself.
LONG_BAN_REASON The ban reason cannot exceed 200 characters.
false The player was successfully banned.

Example Output

{
    "error": false
}

Unban

API Endpoint Method Authentication
https://bedrockbans.com/api/unban.php POST Yes

Parameters

Parameter About
server-name The 16 character string generated for you by registration endpoint.
access-token The 32 character string generated for you by registration endpoint.
unban-xuid The XUID of the player being unbanned.

Errors

Error About
INCOMPLETE_API_REQUEST Some or all parameters are missing.
SERVER_NOT_REGISTERED This server isn't registered.
INVALID_ACCESS_TOKEN The access token is incorrect.
INVALID_UNBAN_PERMISSIONS You don't have permission to unban players.
INVALID_UNBAN_XUID The XUID format is incorrect.
XUID_NOT_BANNED This player isn't banned.
INVALID_SERVER_NAME You can only unban players from your own server.
false The player was successfully unbanned.

Example Output

{
    "error": false
}

Check Ban

To see if a player is banned use this URL: https://bedrockbans.com/api/bans/SERVERNAME/BANNEDXUID.json

*If a player is banned the HTTP status code will be 200. If they aren't banned the HTTP status code will be 404.

Parameters

Parameter About
SERVERNAME The server name who's bans you are checking.
BANNEDXUID The XUID of the player you are checking.

Get Xbox Data

Parameters

Parameter About
XUID The XUID of the player who's gamertag you want to know.

Parameters

Parameter | About GAMERTAG | The gamertag of the player who's XUID you want to know.

Example Output

{
    "xuid": 111111111111111,
    "gamertag": "gamertag here",
    "time": 1526472001
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment