Module: RelicLink::Coh3::Api::Endpoints::Replays

Included in:
RelicLink::Coh3::Api::Endpoints
Defined in:
lib/relic_link/coh3/api/endpoints/replays.rb

Overview

Endpoint definitions for the internal CoH3 replays API.

Instance Method Summary collapse

Instance Method Details

#replay_url(options = {}) ⇒ Object

Request a signed download URL for a replay at the given path, using the given authentication token. Path values can be retrieved from any endpoint that returns a player’s game history, by looking for a matchurls key in the JSON response. Note that this is a protected internal endpoint, which means a request without a valid token will return an authentication error. Tokens can be extracted from the game client by setting up a man-in-the-middle proxy between your game client and the Relic servers, but be warned that tokens expire quickly and this endpoint may change at any time. Use at your own risk!

Relic generally keeps a player’s 10 most recent replay files, and files older than that are removed from storage and inaccessible. When this happens, the replay is considered expired and requests for that path will raise an error.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :token (String)

    Valid CoH3 game client authentication token (required)

  • :path (String)

    Path to a CoH3 replay file stored on Relic’s infrastructure (required)

Raises:



31
32
33
34
35
36
37
38
# File 'lib/relic_link/coh3/api/endpoints/replays.rb', line 31

def replay_url(options = {})
  validate_options!(options)
  get(replays, 'requestSignedReplayDownloadUri', {
        connect_id: options[:token],
        key: options[:path],
        sessionID: options[:token]
      })
end