Subsistence

Subsistence

Not enough ratings
Dedicated Server Remote API
By ColdGames
How to enable a web service on your dedicated server for sending remote API calls via HTTP.
   
Award
Favorite
Favorited
Unfavorite
Introduction
The Web Service API allows your dedicated server to receive and respond to remote HTTP calls. This allows server admins to do things such as post live in-game messages to display to all players, or query stats on the current game.

*The API will expand it's functionality as the game continues to develop.
Enable the web service on your server:
To allow your server to receive http calls, you must enable the web service in UDKWeb.ini (within /UDKGame/Config/). Note: The server must run at least once to generate the various UDK*.ini config files.

Set bEnabled to true and set a username and password (these can be whatever you choose and the password does not need to match the password you are using for your admin login when joining the server in-game).


Run your server:
Now when running your server like normal, you will see in the log that the web service has been enabled, which will list your service ip:port that you will use to connect:

Make a call to the API:
In this example I am using Postman[www.postman.com] to test calls against the API, but you can use any command-line/scripting tools (such as curl, etc).

Set your username/password headers:
Set request headers for username and password to match what you have set for AdminWebUsername and AdminWebPassword in your UDKWeb.ini config.

We can now test the web service is running by making a call to it's status endpoint (all endpoints are prefixed with http://<ip:port>/admin):
Example: http://123.123.123.123:12345/admin/status (replace ip:port with your server ip, and port will be what you have set for ListenPort in UDKWeb.ini).
If the service is reachable you should see a response like the following:

If you get a timeout on the request, check that the ListenPort you have set in your UDKWeb.ini is correctly forwarded on your server machine to accept incoming http requests (see reference for port forwarding[www.noip.com]).
API endpoints:
/admin/serverMessage
Posts an in-game message to all players for a set duration. Displays in the top-left the player's display. HTTP request type: POST.

Param
Description
message
(Required) The message to display in-game. Max character length 448. Use url encoded for specific formating.
duration
(Optional) Number of seconds the message should display. Min == 5, max == 90, default == 12.

Example:

Will display in-game as follows:
4 Comments
Anyhit 2 Feb, 2022 @ 10:19am 
is it possible to add the Parameter "Steam game server UID" in this webserver in next update? That would be nice, so i can timely read it out here.
ʤνįɭ401 8 Jan, 2022 @ 4:09am 
Hey there, I believe by design using the Message header instead of a POST body in the announce request isn't the ideal way.

Inputs in a POST request should always be in the body, make it either a JSON payload or the usual Form values.
Пельменище 19 Dec, 2021 @ 3:37am 
Через браузер можно как то управлять?
Пельменище 17 Dec, 2021 @ 7:22am 
А как обновить сервер на тестовый?