Stats

API change history

API that provides statistical data about Players and Matches.

Halo 5 - Match Result - Arena

Retrieves detailed statistics for a Match with the Arena Game Mode.


Changelog

December 22, 2017:

  • Added Game Mode clarifications to the Endpoint description.

February 21, 2017:

  • Renamed Endpoint from "Post-Game Carnage Report: Arena" to "Halo 5 - Match Result - Arena".
  • Removed "{title}" Request Parameter.
  • Updated the documentation for "GameVariantResourceId" and "MapVariantResourceId" to reference the UGC API.

May 16, 2016:

  • Documented HTTP 503 Response Code.
  • Added documentation for the "MatchSpeedWinAmount", "ObjectivesCompletedAmount", and "BoostData" fields.

April 20, 2016:

  • Added documentation for the "GameVariantResourceId", "MapVariantResourceId", and "PlayerScore" fields.
  • Updated the documentation for the "MapVariantId" and "GameVariantId" fields with the recommendation of using the "MapVariantResourceId" and "GameVariantResourceId" fields, respectively.

Try it

Request

Request URL

Request parameters

  • string

    An ID that uniquely identifies a Match. Match IDs can be retrieved from the "Halo 5 - Player Match History" Endpoint.

Request headers

  • string
    Subscription key which provides access to this API. Found in your Profile.

Request body

Responses

200 OK

The response body will contain the Match Result.

Representations

{
  // A list of stats for each player who was present in the match.
  "PlayerStats": [
    {
      // The experience information for the player in this match.
      "XpInfo": {

        // The player's Spartan Rank before the match started.
        "PrevSpartanRank": "int",

        // The player's Spartan Rank after the match ended.
        "SpartanRank": "int",

        // The player's XP before the match started.
        "PrevTotalXP": "int",

        // The player's XP after the match ended.
        "TotalXP": "int",

        // The multiplier on the XP earned this match based on their Spartan Rank when
        // the match ended.
        "SpartanRankMatchXPScalar": "double",

        // The portion of the XP the player earned this match that was based on how much
        // time was spent in-match.
        "PlayerTimePerformanceXPAward": "int",

        // The XP awarded to the player based on how their team ranked when the match
        // concluded.
        "PerformanceXP": "int",

        // The XP awarded to the player for their team-agnostic rank.
        "PlayerRankXPAward": "int",

        // The amount of XP the player earned if they played a boost card for this match,
        // and the boost card criteria was met. This is a fixed amount of XP, not a
        // multiplier.
        "BoostAmount": "int",

        // The amount of XP the player earned for finishing the match quickly.
        "MatchSpeedWinAmount": "int",

        // The amount of XP the player earned for completing objectives.
        "ObjectivesCompletedAmount": "int"
      },

      // The Competitive Skill Ranking (CSR) of the player before the match started. If
      // the player is still in measurement matches, this field is null. If the player
      // finished the last measurement match this match, this field is still null.
      "PreviousCsr": {

        // The CSR tier. CSR Tiers are designation-specific and are available via the
        // Metadata API.
        "Tier": "int",

        // The Designation of the CSR. CSR Designations are available via the Metadata
        // API.
        "DesignationId": "int",

        // The CSR value. Zero for normal (Diamond and below) designations.
        "Csr": "int",

        // The percentage of progress towards the next CSR tier.
        "PercentToNextTier": "int",

        // If the CSR is Onyx or Champion, the player's leaderboard ranking. Null
        // otherwise.
        "Rank": "int"
      },

      // The Competitive Skill Ranking (CSR) of the player after the match ended. If the
      // player is still in measurement matches, this field is null.
      "CurrentCsr": {

        // The CSR tier. CSR Tiers are designation-specific and are available via the
        // Metadata API.
        "Tier": "int",

        // The Designation of the CSR. CSR Designations are available via the Metadata
        // API.
        "DesignationId": "int",

        // The CSR value. Zero for normal (Diamond and below) designations.
        "Csr": "int",

        // The percentage of progress towards the next CSR tier.
        "PercentToNextTier": "int",

        // If the CSR is Onyx or Champion, the player's leaderboard ranking. Null
        // otherwise.
        "Rank": "int"
      },

      // The player's measurement matches left. If this field is greater than zero, then
      // the player will not have a CSR yet. If the player finished the match, this match
      // is included in this count.
      "MeasurementMatchesLeft": "int",

      // The set of rewards that the player got in this match.
      "RewardSets": [
        {
          // The ID of the reward.
          "RewardSet": "guid",

          // The source of the reward. Options are:
          //   None = 0,
          //   Meta Commendation = 1,
          //   Progress Commendation = 2,
          //   Spartan Rank = 3
          "RewardSourceType": "int",

          // If the Reward Source is Spartan Rank, this value is set to the Spartan Rank
          // the player acquired that led to this reward being granted. Note: Unlike the
          // commendations fields in this structure, this is not the GUID to a Spartan
          // Rank content item. That's because the Spartan Rank content item itself does
          // not detail what specific Spartan Rank it pertains to - this information is
          // derived from the list of Spartan Ranks as a whole. Spartan Ranks are
          // available via the Metadata API.
          "SpartanRankSource": "int",

          // If the Reward Source is a Commendation, this is the ID of the level of the
          // commendation that earned the reward.
          "CommendationLevelId": "guid",

          // If the Reward Source is a Meta Commendation or Progress Commendation, this
          // is the ID of the Meta Commendation or Progress Commendation, respectively,
          // that earned the reward. Commendations are available via the Metadata API.
          "CommendationSource": "guid"
        },

      ],

      // The number of times the player killed each opponent. If the player did not kill
      // an opponent, there will be no entry for that opponent.
      "KilledOpponentDetails": [
        {
          // The gamertag of the opponent that was killed.
          "GamerTag": "string",

          // The number of times that opponent was killed.
          "TotalKills": "int"
        }
      ],

      // The number of times the player was killed by each opponent. If the player was
      // not killed by an opponent, there will be no entry for that opponent.
      "KilledByOpponentDetails": [
        {
          // The gamertag of the opponent that killed the player.
          "GamerTag": "string",

          // The number of times the opponent killed the player.
          "TotalKills": "int"
        }
      ],

      // The game base variant specific stats for this match. Flexible stats are
      // available via the Metadata API.
      "FlexibleStats": {

        // The set of flexible stats that are derived from medal events.
        "MedalStatCounts": [
          {
            // The ID of the flexible stat.
            "Id": "guid",

            // The number of times this flexible stat was earned.
            "Count": "int"
          }
        ],

        // The set of flexible stats that are derived from impulse events.
        "ImpulseStatCounts": [
          {
            // The ID of the flexible stat.
            "Id": "guid",

            // The number of times this flexible stat was earned.
            "Count": "int"
          }
        ],

        // The set of flexible stats that are derived from medal time lapses.
        "MedalTimelapses": [
          {
            // The ID of the flexible stat.
            "Id": "guid",

            // The amount of time the flexible stat was earned for. This is expressed as
            // an ISO 8601 Duration.
            "Timelapse": "string"
          }
        ],        

        // The set of flexible stats that are derived from impulse time lapses.
        "ImpulseTimelapses": [
          {
            // The ID of the flexible stat.
            "Id": "guid",

            // The amount of time the flexible stat was earned for. This is expressed as
            // an ISO 8601 Duration.
            "Timelapse": "string"
          }
        ]
      },

      // Details on any credits the player may have earned from playing this match.
      "CreditsEarned": {

        // Indicates how the credits result was arrived at. Options are:
        //   Credits Disabled In Playlist = 0,
        //   Player Did Not Finish = 1,
        //   Credits Earned = 2
        // Credits Disabled In Playlist: TotalCreditsEarned is zero because this playlist
        // has credits disabled.
        // Player Did Not Finish: Credits are enabled in this playlist, but
        // TotalCreditsEarned is zero because the player did not finish the match.
        // Credits Earned: Credits are enabled in this playlist and the player completed
        // the match, so the credits formula was successfully evaluated. The fields below
        // provide the client with the values used in the formula. Note: That if we used
        // one or more default values, we still return "NormalResult". The fields below
        // will confirm the actual values used.
        "Result": "int",

        // The total number of credits the player earned from playing this match.
        "TotalCreditsEarned": "int",

        // The scalar applied to the credits earned based on the player's Spartan Rank.
        "SpartanRankModifier": "double",

        // The portion of credits earned due to the player's team-agnostic rank in the
        // match.
        "PlayerRankAmount": "int",

        // The portion of credits earned due to the time the player played in the match.
        "TimePlayedAmount": "double",

        // The portion of credits earned due to the boost card the user applied
        "BoostAmount": "int"
      },

      // The player's progress towards meta commendations. Commendations that had no
      // progress earned this match will not be returned. 
      "MetaCommendationDeltas": [
        {
          // The commendation ID. Commendations are available via the Metadata API.
          "Id": "guid",

          // The progress the player had made towards the commendation level before the
          // match. In C#, this can be reassembled into a Guid in the following manner:
          // new Guid((int)Data1, (short)Data2, (short)Data3,
          // BitConverter.GetBytes((long)Data4)).
          "PreviousMetRequirements": [
            {
              "Data1": "int",

              "Data2": "int",

              "Data3": "int",

              "Data4": "int"
            }
          ],

          // The progress the player had made towards the commendation level after the
          // match. In C#, this can be reassembled into a Guid in the following manner:
          // new Guid((int)Data1, (short)Data2, (short)Data3,
          // BitConverter.GetBytes((long)Data4)).
          "MetRequirements": [
            {
              "Data1": "int",

              "Data2": "int",

              "Data3": "int",

              "Data4": "int"
            }
          ]
        }
      ],

      // The player's progress towards progressive commendations. Commendations that had
      // no progress earned this match will not be returned.
      "ProgressiveCommendationDeltas": [
        {
          // The commendation ID. Commendations are available via the Metadata API.
          "Id": "guid",

          // The progress the player had made towards the commendation level before the
          // match.
          "PreviousProgress": "int",

          // The progress the player had made towards the commendation level after the
          // match.
          "Progress": "int"
        }
      ],

      // Details on the boost card the user used in this match. If the user did not use a
      // boost card this field will be null.
      "BoostData": {

        // The identifier of the boost card that was used. Boost cards are available via
        // the Requisitions Metadata API.
        "DefinitionId": "guid",

        // Whether the card was consumed because its conditions were met. If not consumed
        // the card is returned to the user's inventory.
        "CardConsumed": "bool"
      },

      "Player": {

         // The player's gamertag.
        "Gamertag": "string",

        // Internal use only. This will always be null.
        "Xuid": null
      },

      // The ID of the team that the player was on when the match ended. 
      "TeamId": "int",

      // The player's team-agnostic ranking.
      "Rank": "int",

      // Indicates whether the player was present in the match when it ended.
      "DNF": "boolean",

      // The player's average lifetime.
      "AvgLifeTimeOfPlayer": "string",

      // Internal use only. This will always be null.
      "PreMatchRatings": null,

      // Internal use only. This will always be null.
      "PostMatchRatings": null,

      // Unused for Arena matches. This will usually be null or contain invalid data.
      "PlayerScore": null,

      // Total number of kills done by the player. This includes melee kills, shoulder
      // bash kills and Spartan charge kills, all power weapons, AI kills and vehicle
      // destructions.       
      "TotalKills": "int",

      // Total number of headshots done by the player.
      "TotalHeadshots": "int",

      // Total weapon damage dealt by the player.
      "TotalWeaponDamage": "double",

      // Total number of shots fired by the player.
      "TotalShotsFired": "int",

      // Total number of shots landed by the player.
      "TotalShotsLanded": "int",

      // The weapon the player used to get the most kills this match.
      "WeaponWithMostKills": {

        "WeaponId": {

          // The ID of the weapon. Weapons are available via the Metadata API.
          "StockId": "int",

          // Any attachments the weapon had.
          "Attachments": [ "int" ]
        },

        // The number of shots fired for this weapon.
        "TotalShotsFired": "int",

        // The number of shots landed for this weapon.
        "TotalShotsLanded": "int",

        // The number of headshots for this weapon.
        "TotalHeadshots": "int",

        // The number of kills for this weapon.
        "TotalKills": "int",

        // The total damage dealt for this weapon.
        "TotalDamageDealt": "double",

        // The total possession time for this weapon. This is expressed as an ISO 8601
        // Duration.
        "TotalPossessionTime": "string"
      },

      // Total number of melee kills by the player.
      "TotalMeleeKills": "int",

      // Total melee damage dealt by the player.
      "TotalMeleeDamage": "double",

      // Total number of assassinations by the player.
      "TotalAssassinations": "int",

      // Total number of ground pound kills by the player.
      "TotalGroundPoundKills": "int",

      // Total ground pound damage dealt by the player.
      "TotalGroundPoundDamage": "double",

      // Total number of shoulder bash kills by the player.
      "TotalShoulderBashKills": "int",

      // Total shoulder bash damage dealt by the player.
      "TotalShoulderBashDamage": "double",

      // Total grenade damage dealt by the player.
      "TotalGrenadeDamage": "double",

      // Total number of power weapon kills by the player.
      "TotalPowerWeaponKills": "int",

      // Total power weapon damage dealt by the player.
      "TotalPowerWeaponDamage": "double",

      // Total number of power weapon grabs by the player.
      "TotalPowerWeaponGrabs": "int",

      // Total power weapon possession by the player. This is expressed as an ISO 8601
      // Duration.
      "TotalPowerWeaponPossessionTime": "string",

      // Total number of deaths by the player.
      "TotalDeaths": "int",

      // Total number of assists by the player.
      "TotalAssists": "int",

      // Not used.
      "TotalGamesCompleted": "int",

      // Not used.
      "TotalGamesWon": "int",

      // Not used.
      "TotalGamesLost": "int",

      // Not used.
      "TotalGamesTied": "int",

      // Total timed played in this match by the player.
      "TotalTimePlayed": "string",

      // Total number of grenade kills by the player.
      "TotalGrenadeKills": "int",

      // The set of Medals earned by the player.
      "MedalAwards": [
        {
          // The ID of the Medal. Medals are available via the Metadata API.
          "MedalId": "int",

          // The number of times the Medal was earned.
          "Count": "int"
        }
      ], 

      // List of enemy vehicles destroyed. Vehicles are available via the Metadata API.
      // Note: this stat measures enemy vehicles, not any vehicle destruction.
      "DestroyedEnemyVehicles": [
        {
          // The enemy this entry references
          "Enemy": {

            // The Base ID for the enemy.
            "BaseId": "int",

            // The attachments (variants) for the enemy.
            "Attachments": [
              "int"
            ]
          },

          // Total number of kills on the enemy by the player
          "TotalKills": "int"
        }
      ],

      // List of enemies killed, per enemy type. Enemies are available via the Metadata
      // API.
      "EnemyKills": [
        {
          // The enemy this entry references
          "Enemy": {

            // The Base ID for the enemy.
            "BaseId": "int",

            // The attachments (variants) for the enemy.
            "Attachments": [
              "int"
            ]
          },

          // Total number of kills on the enemy by the player
          "TotalKills": "int"
        }
      ],

      // The set of weapons (weapons and vehicles included) used by the player.
      "WeaponStats": [
        {
          "WeaponId": {

              // The ID of the weapon. Weapons are available via the Metadata API.
            "StockId": "int",

              // Any attachments the weapon had.
            "Attachments": [ 
              "int" 
            ]
          },

          // The number of shots fired for this weapon.
          "TotalShotsFired": "int",

          // The number of shots landed for this weapon.
          "TotalShotsLanded": "int",

          // The number of headshots for this weapon.
          "TotalHeadshots": "int",

          // The number of kills for this weapon.
          "TotalKills": "int",

          // The total damage dealt for this weapon.
          "TotalDamageDealt": "double",

          // The total possession time for this weapon. This is expressed as an ISO 8601
          // Duration.
          "TotalPossessionTime": "string"
        }
      ],

      // The set of Impulses (invisible Medals) earned by the player.
      "Impulses": [
        {
          // The ID of the Impulse. Impulses are available via the Metadata API.
          "Id": "int",

          // The number of times the Impulse was earned.
          "Count": "int"
        }
      ],

      // Total number of Spartan kills by the player.
      "TotalSpartanKills": "int"
    }
  ],

  // A list of stats for each team who in the match. Note that in Free For All modes,
  // there is an entry for every player.
  "TeamStats": [
    {
      // The ID for the team.
      "TeamId": "int",

      // The team's score at the end of the match. The way the score is determined is
      // based off the game base variant being played: 
      //   Breakout = number of rounds won,
      //   CTF = number of flag captures,
      //   Slayer = number of kills,
      //   Strongholds = number of points,
      //   Warzone = number of points.
      // Score can be a negative value. Unfortunately, this value is returned as an
      // unsigned 32-bit integer. This means that if the score is -1, the score reported
      // is 4,294,967,295.
      "Score": "uint32",

      // The team's rank at the end of the match.
      "Rank": "int",

      // The set of round stats for the team.
      "RoundStats": [
        {
          // The round number this entry pertains to.
          "RoundNumber": "int",

          // The end rank for the team this round.
          "Rank": "int",

          // The end score for the team this round.
          // Score can be a negative value. Unfortunately, this value is returned as an
          // unsigned 32-bit integer. This means that if the score is -1, the score
          // reported is 4,294,967,295.
          "Score": "uint32",

        }
      ]
    }
  ],

  // Indicates if the match is completed or not. Some match details are available while
  // the match is in-progress, but the behavior for incomplete matches in undefined.
  "IsMatchOver": "boolean",

  // The length of the match. This is expressed as an ISO 8601 Duration.
  "TotalDuration": "string",

  // The variant of the map for this match. Map variants are available via the Metadata
  // API. More information is available in MapVariantResourceId.
  "MapVariantId": "guid",

  // The variant of the game for this match. Game variants are available via the Metadata
  // API. More information is available in GameVariantResourceId.
  "GameVariantId": "guid",

  // The playlist ID of the match. Playlists are available via the Metadata API.
  "PlaylistId": "guid",

  // The ID of the base map for this match. Maps are available via the Metadata API.
  "MapId": "guid",

  // The ID of the game base variant for this match. Game base variants are available via
  // the Metadata API.
  "GameBaseVariantId": "guid",

  // Whether this was a team-based game or not.
  "IsTeamGame": "boolean",

  // The ID of the season for this match if it was played in a seasonal playlist. Null if
  // the match was played in a non-seasonal playlist.
  "SeasonId": "guid",

  // The variant of the game for this match. There are two sources of game variants:
  // official game variants available via the Metadata API and user-generated game
  // variants available via the UGC API.
  "GameVariantResourceId": {

    // The resource type. 2 indicates game variant.
    "ResourceType": 2,

    // The ID of the game variant. Official game variants are available via the Metadata
    // API.
    "ResourceId": "guid",        

    // The source of the game variant. Options are:
    //   Unknown = 0,
    //   User-generated = 1,
    //   Official = 3.
    "OwnerType": "int",

    // The gamertag of the user that created the game variant if this is a user-generated
    // game variant, or null otherwise. 
    "Owner": "string"
  },

  // The variant of the map for this match. There are two sources of map variants:
  // official map variants available via the Metadata API and user-generated map variants
  // available via the UGC API.
  "MapVariantResourceId": {

    // The resource type. 3 indicates map variant.
    "ResourceType": 3,

    // The ID of the map variant. Official map variants are available via the Metadata
    // API.
    "ResourceId": "guid",

    // The source of the map variant. Options are:
    //   Unknown = 0,
    //   User-generated = 1,
    //   Official = 3.
    "OwnerType": "int",

    // The gamertag of the user that created the map variant if this is a user-generated
    // map variant, or null otherwise. 
    "Owner": "string"
  }
}

404 Not Found

The specified Match could not be found.

Representations

500 Internal Server Error

Internal Server Error

Representations

503 Service Unavailable

Service Unavailable

Representations

Code samples

@ECHO OFF

curl -v -X GET "https://www.haloapi.com/stats/h5/arena/matches/{matchId}"
-H "Ocp-Apim-Subscription-Key: {subscription key}"

--data-ascii "{body}" 
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;

namespace CSHttpClientSample
{
    static class Program
    {
        static void Main()
        {
            MakeRequest();
            Console.WriteLine("Hit ENTER to exit...");
            Console.ReadLine();
        }
        
        static async void MakeRequest()
        {
            var client = new HttpClient();
            var queryString = HttpUtility.ParseQueryString(string.Empty);

            // Request headers
            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");

            var uri = "https://www.haloapi.com/stats/h5/arena/matches/{matchId}?" + queryString;

            var response = await client.GetAsync(uri);
        }
    }
}	
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class JavaSample 
{
    public static void main(String[] args) 
    {
        HttpClient httpclient = HttpClients.createDefault();

        try
        {
            URIBuilder builder = new URIBuilder("https://www.haloapi.com/stats/h5/arena/matches/{matchId}");


            URI uri = builder.build();
            HttpGet request = new HttpGet(uri);
            request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");


            // Request body
            StringEntity reqEntity = new StringEntity("{body}");
            request.setEntity(reqEntity);

            HttpResponse response = httpclient.execute(request);
            HttpEntity entity = response.getEntity();

            if (entity != null) 
            {
                System.out.println(EntityUtils.toString(entity));
            }
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
}

<!DOCTYPE html>
<html>
<head>
    <title>JSSample</title>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
</head>
<body>

<script type="text/javascript">
    $(function() {
        var params = {
            // Request parameters
        };
      
        $.ajax({
            url: "https://www.haloapi.com/stats/h5/arena/matches/{matchId}?" + $.param(params),
            beforeSend: function(xhrObj){
                // Request headers
                xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key","{subscription key}");
            },
            type: "GET",
            // Request body
            data: "{body}",
        })
        .done(function(data) {
            alert("success");
        })
        .fail(function() {
            alert("error");
        });
    });
</script>
</body>
</html>
#import <Foundation/Foundation.h>

int main(int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    
    NSString* path = @"https://www.haloapi.com/stats/h5/arena/matches/{matchId}";
    NSArray* array = @[
                         // Request parameters
                         @"entities=true",
                      ];
    
    NSString* string = [array componentsJoinedByString:@"&"];
    path = [path stringByAppendingFormat:@"?%@", string];

    NSLog(@"%@", path);

    NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
    [_request setHTTPMethod:@"GET"];
    // Request headers
    [_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
    // Request body
    [_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
    
    NSURLResponse *response = nil;
    NSError *error = nil;
    NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];

    if (nil != error)
    {
        NSLog(@"Error: %@", error);
    }
    else
    {
        NSError* error = nil;
        NSMutableDictionary* json = nil;
        NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
        NSLog(@"%@", dataString);
        
        if (nil != _connectionData)
        {
            json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
        }
        
        if (error || !json)
        {
            NSLog(@"Could not parse loaded json with error:%@", error);
        }
        
        NSLog(@"%@", json);
        _connectionData = nil;
    }
    
    [pool drain];

    return 0;
}
<?php
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';

$request = new Http_Request2('https://www.haloapi.com/stats/h5/arena/matches/{matchId}');
$url = $request->getUrl();

$headers = array(
    // Request headers
    'Ocp-Apim-Subscription-Key' => '{subscription key}',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
);

$url->setQueryVariables($parameters);

$request->setMethod(HTTP_Request2::METHOD_GET);

// Request body
$request->setBody("{body}");

try
{
    $response = $request->send();
    echo $response->getBody();
}
catch (HttpException $ex)
{
    echo $ex;
}

?>
########### Python 2.7 #############
import httplib, urllib, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.urlencode({
})

try:
    conn = httplib.HTTPSConnection('www.haloapi.com')
    conn.request("GET", "/stats/h5/arena/matches/{matchId}?%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################

########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.parse.urlencode({
})

try:
    conn = http.client.HTTPSConnection('www.haloapi.com')
    conn.request("GET", "/stats/h5/arena/matches/{matchId}?%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################
require 'net/http'

uri = URI('https://www.haloapi.com/stats/h5/arena/matches/{matchId}')

request = Net::HTTP::Get.new(uri.request_uri)
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request body
request.body = "{body}"

response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
    http.request(request)
end

puts response.body