• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

REST Web API Endpoints

savaresejt

New member
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