Download a File

Beacon uses the GET /servers/{serverId}/files/{path} endpoint to download files. The file’s contents should be included as the body of the response. Return a 404 status code if the file does not exist.

Request Path Rules

  • Paths must always use url-style forward slashes (/) not backward slashes (\).
  • Paths containing ../ will be rejected.
  • ./ and // will be replaced with /.
  • Leading and trailing slashes will be removed.
  • Do not encode the path components. Example: use Ark: Survival Ascended/ShooterGame/Saved/Config/WindowsServer/Game.ini not Ark%3A%20Survival%20Ascended/ShooterGame/Saved/Config/WindowsServer/Game.ini.

Content Verification Headers

Content verification is optional but is strongly recommended for uploading and downloading files.

Every request that Beacon makes will include a Want-Content-Digest header. Currently, the value of this header is sha-512=10,sha-256=9,md5=0,sha=0,unixsum=0,unixcksum=0,adler=0,crc32c=0 but check the actual header in case the value changes. For brevity, most example requests in this documentation omit this header.

If the server includes a Content-Digest response header with a compatible hash, Beacon will verify the response body and retry the request if the hash does not match. Beacon will attempt two retries (for a total of three attempts) before displaying an error to the user.

All Beacon requests that include a body also include a Content-Digest request header. At the time of this writing, Beacon requests contain both SHA-512 and SHA-256 hashes. If it cannot verify the request, the server should reply with a 406 status.

Example Exchange

Request

GET /servers/bebb2aae-99bb-41be-b928-5374d6dabc61/files/Game.ini HTTP/1.1
Authorization: KEY secretToken
Host: api.example.com
Want-Content-Digest: sha-512=10,sha-256=9,md5=0,sha=0,unixsum=0,unixcksum=0,adler=0,crc32c=0

Response

HTTP/1.1 200 OK
Content-Digest: sha-512=:uBJBUBqFLk4jFu4qW1WVA4FRubafx1gnZEHDCEmaNyt+JJwrAyJX5l1mKIcFQKXijnkteHJy8FJGy1xjaWteAQ==:
Content-Type: application/octet-stream

[/script/shootergame.shootergamemode]
bUseSingleplayerSettings=False