Skip to content

Developer Guides ‐ CRCON API

ElGuillermo edited this page Jan 3, 2025 · 28 revisions

🧭 You are here : Wiki home / Developer Guides / CRCON API


Menu


CRCON API

There is an API for CRCON available at http://(your VPS IP):8010/api/ (first -or only- game server managed in CRCON)

CRCON API Endpoint Documentation

You'll find a list of endpoints and related documentation at http://(your VPS IP):8010/api/get_api_documentation

Generate an API token

You can generate an API token in the admin panel located here : http://(your VPS IP):8010/admin

Each token you'll create will get the permissions of the user it belongs.
If you want your API token to have full permissions, create a dedicated user and give him "superuser" status, then create a token from his account.

Create User

Create new user with permissions you wish for the API key to have.

  1. Login to the Admin interface at http://(your VPS IP):8010/admin
  2. Click the '+Add' link, next to users
  3. Enter username and password and click Save and continue editing
  • The password can be random and forgotten, Steam ID ins't required.
  1. Ensure that the account has the Active checkbox checked.
  2. Provide permission to user
  • You can give specific permissions to each user via the Permissions section or Groups.

Create an API Key

  1. Login to the Admin interface at http://(your VPS IP):8010/admin
  2. Click the +Add link, next to Django API Keys

image

Important

The API key will be provided in next step, make sure you copy this down and save it. You will not see it again.

  1. Fill out API details and click Save
  • Select the user for the API Key.
  • Add notes (great for tracking API keys)

Accessing CRCON API

You can access them through the various endpoints available at http://(your VPS IP):8010/api/, most of which require authentication.

Curl Examples

Get Current Map rotation

curl https://(your VPS IP):8010/api/get_map_rotation -H "Authorization: Bearer <django-api-token>"

Get Historical Logs

curl -X POST https://(your VPS IP):8010/api/get_historical_logs -H "Authorization: Bearer <django-api-token>" -d '{"log_type":"KILL", 
"limit":9999}'

Get Gamestate (hll_seed_vip)

curl -X POST https://(your VPS IP):8010/api/get_gamestate -H "Authorization: Bearer <django-api-token>"

Python Example

import requests

headers = {
    "Authorization": "bearer 12345678-your-api-token-123456789",
    "Connection": "keep-alive",
    "Content-Type": "application/json"
}

data_request={
    "player": "ThisGuy",
    "steam_id_64": "765611981123456952",
    "message": "test"
}

foo = requests.post("http://(your VPS IP):8010/api/do_message_player", data=json.dumps(data_request), headers=headers)

API Browser Tools

You can use Postman to send API requests to your CRCON.

Example config in Postman :

image

image

HLL Community RCON Wiki

📦 Getting Started

📖 User Guide

🕵️ Main interface

Home

Views
  • Live (waiting for update)
  • Team (waiting for update)
Maps
Records
Settings
Webhooks
Automods
Others
Stats

🧑‍🤝‍🧑 Public (stats) interface

(TODO)

🧙‍♂️ Admin panel

Additional Setup

🛠️ Additional installs

💾 Backup

🚚 Moving/changing servers

👽 Specific server providers setups

⚗️ Developer Guides

🆘 Troubleshooting & Help

Common procedures

Need help ?

Clone this wiki locally