Upload Endpoint


This endpoint is used for uploading Heroes of the Storm replay files to Heroes Profile

For use with uploaders that can parse replays for fingerprint data

Method URI Headers
POST /upload?fingerprint=we324ersder Default

For use with uploaders that cannot parse replays and cannot get fingerprint data.

Method URI Headers
POST /upload/alt Default

Data Parameters (for use with uploaders that can parse)

fingerprint:

Fingerprint is calculated by taking the sorted players blizz_id, appending each one to a string, then adding that replay files random value to the end of that string. Then running MD5 hash on the string. Finally the result is converted to Guid.

Partial c# code

public string GetFingerprint(Replay replay)
{
    var str = new StringBuilder();
    replay.Players.Select(p => p.BattleNetId).OrderBy(x => x).Map(x => str.Append(x.ToString()));
    str.Append(replay.RandomValue);
    var md5 = MD5.Create().ComputeHash(Encoding.UTF8.GetBytes(str.ToString()));
    var result = new Guid(md5);
    return result.ToString();
}

Partial PHP Code

{
  $players = $data["players"];
  usort($players, [$this, 'cmp']);
  $string = "";
  for($i = 0; $i < count($players); $i++){
    $string .= $players[$i]["blizz_id"];
  }
  $string .= $data["random_value"];
  $hash = md5($string, true);
  $fingerprint = $this->bytesToGuid($hash);
}