• Mods are now organized as resources. Use the Mods link above to browse for or submit a mod, tool, or prefab.

    The TFP Official Modding Forum Policy establishes the rules and guidelines for mod creators and mod users.

REST Web API Endpoints

savaresejt

Refugee
Hi! I just noticed that there's a slick dashboard where I can create web tokens for my server. Is there a restful interface that comes with it as well? I was looking around and couldn't find any swagger docs or simple examples of a curl request to the API if there is one?  

 

 
Got it! This works great in case anyone is searching the forum. You can put in whatever server admin command you like here instead of the spawn entity, this one just spawns 1 of everything in the game.

1..178 | ForEach-Object { Invoke-RestMethod -Uri 'http://serverip:8080/api/command' -Method Post -Headers @{"X-SDTD-API-TOKENNAME"="redacted"; "X-SDTD-API-SECRET"="redacted"} -Body (@{command="se 1508 $_ 1"} | ConvertTo-Json) -ContentType "application/json" }

 
Back
Top