Skip to content

Methods & parameters

Luís Gustavo edited this page Jun 29, 2018 · 112 revisions

Connectivity

Create Session

/CreateSession[ResponseFormat]/{devID}/{signature}/{timestamp}
A required step to Authenticate the developerId/signature for further API use.

Parameter Description Example
ResponseFormat JSON or XML json
devID The devID from your Credentials 1004
signature The Signature of "createsession" method de9a8114c56e02abd057a0f2d9671b7d
timestamp The current Timestamp 20180628012612

The Session is contained in an element called “session_id”. This parameter is needed to call the other methods.



Requesting JSON: http://api.realmroyale.com/realmapi.svc/CreateSessionJSON/1004/de9a8114c56e02abd057a0f2d9671b7d/20180628012612

Response: JSON

{
	"ret_msg": "Approved",
	"session_id": "1465AFCA32DBDB800CEF8C72F296C52C",
	"timestamp": "6/28/2018 1:26:12 AM"
}

Requesting XML: http://api.realmroyale.com/realmapi.svc/CreateSessionXML/1004/de9a8114c56e02abd057a0f2d9671b7d/20180628012612

Response: XML

<Session>
	<ret_msg>Approved</ret_msg>
	<session_id>1465AFCA32DBDB800CEF8C72F296C52C</session_id>
	<timestamp>6/28/2018 1:26:12 AM</timestamp>
</Session>

Get Data Used

/GetDataUsed[ResponseFormat]/{devID}/{signature}/{session_Id}/{timestamp}
Returns API Developer daily usage limits and the current status against those limits.

Parameter Description Example
ResponseFormat JSON or XML json
devID The devID from your Credentials 1004
signature The Signature of "getdataused" method 373607841571123d501d6febfb43d5e7
session_id A valid session_id 1465AFCA32DBDB800CEF8C72F296C52C
timestamp The current Timestamp 20180628012612



Request: http://api.realmroyale.com/realmapi.svc/GetDataUsedJSON/1004/373607841571123d501d6febfb43d5e7/1465AFCA32DBDB800CEF8C72F296C52C/20180628012612

Response: JSON

{
	"Active_Sessions": 9,
	"Concurrent_Sessions": 50,
	"Request_Limit_Daily": 7500,
	"Session_Cap": 500,
	"Session_Time_Limit": 15,
	"Total_Requests_Today": 51,
	"Total_Sessions_Today": 29,
	"ret_msg": null
}

Ping

/Ping[ResponseFormat]
A quick way of validating access to the Realm Royale API.

Parameter Description Example
ResponseFormat JSON or XML json


Request: http://api.realmroyale.com/realmapi.svc/PingJSON

Response: TEXT PLAIN

RealmAPI (ver 1.0.0.0) [PATCH - 0.3.225.0] - Ping successful. Server Date:6/28/2018 1:26:12 AM

Test Session

/TestSession[ResponseFormat]/{devId}/{signature}/{session_id}/{timestamp}
A means of validating that a session is established.

Parameter Description Example
ResponseFormat JSON or XML json
devID The devID from your Credentials 1004
signature The Signature of "testsession" method 776593aeca54002ea815a1b6ea4c7c7e
session_id A valid session_id 1465AFCA32DBDB800CEF8C72F296C52C
timestamp The current Timestamp 20180628012612


Request: http://api.realmroyale.com/realmapi.svc/TestSessionJSON/1004/776593aeca54002ea815a1b6ea4c7c7e/1465AFCA32DBDB800CEF8C72F296C52C/20180628012612

Response: TEXT PLAIN

This was a successful test with the following parameters added: developer: 1004 time: 6/28/2018 1:26:12 AM signature: c332691773af33948c9ddb12e5fb444f session: 1465AFCA32DBDB800CEF8C72F296C52C

APIs

Get Player

/GetPlayer[ResponseFormat]/{devId}/{signature}/{session_id}/{timestamp}/{player}/{platform}
Returns basic player information.

Parameter Description Example
ResponseFormat JSON or XML json
devID The devID from your Credentials 1004
signature The Signature of "getplayer" method b2dbe06013c94040b739775776c780a6
session_id A valid session_id 1465AFCA32DBDB800CEF8C72F296C52C
timestamp The current Timestamp 20180628012612
player playerId (int), playerName (string) or steamId (int) RealmHero
platform HIREZ or STEAM hirez

Request: http://api.realmroyale.com/realmapi.svc/GetPlayerJSON/1004/b2dbe06013c94040b739775776c780a6/1465AFCA32DBDB800CEF8C72F296C52C/20180628012612/RealmHero/hirez

Response: JSON

{
	"created_datetime": "3\/18\/2018 5:14:27 PM",
	"id": 123,
	"last_login_datetime": "6\/12\/2018 7:51:11 PM",      
	"level": 22,
	"name": "RealmHero",
	"region": "Europe",
	"ret_msg": null,
	"steam_id": 76561198199559770
}

Get Player Stats

/GetPlayerStats[ResponseFormat]/{devId}/{signature}/{session_id}/{timestamp}/{player}
Returns player stats for each [match_queue_id (solo 474, duo 475, quad 476), class (Warrior, Hunter, Mage, Engineer, Assassin)] combination. average_placement and placements are TBD based on query performance and will likely be that for only the past 30 days due to purging of the source table.

Parameter Description Example
ResponseFormat JSON or XML json
devID The devID from your Credentials 1004
signature The Signature of "getplayerstats" method f7bd9ee8e379d848bee953f64e3848c3
session_id A valid session_id 1465AFCA32DBDB800CEF8C72F296C52C
timestamp The current Timestamp 20180628012612
player playerId (int) or playerName (string) 123

Request: http://api.realmroyale.com/realmapi.svc/GetPlayerStatsJSON/1004/f7bd9ee8e379d848bee953f64e3848c3/1465AFCA32DBDB800CEF8C72F296C52C/20180628012612/123

Response: JSON

{      
  "id": 123,
  "aggregate_stats": {         
      "games_played": 2521,
      "kills_player": 1371,
      "kills_bot": 46,
      "killing_spree_max": 25,
      "deaths": 2479,
      "assists": 1214,
      "duration_secs": 5210000,
      "damage_player": 220190,
      "damage_taken": 43790,
      "damage_mitigated": 5942,
      "healing_player": 249.999985,
      "healing_player_self": 6635,
      "wins": 8,
      "losses": 1519,
      "wards_mines_placed": 11098,
      "earned_xp": 1575850,
      "earned_tokens": 1442,
      "average_placement": 23,
      "placements": {"1": 8, "2": 7, "3": 13, "4": 12, "... 28": 0, "29": 3}
  },
  "queue_class_stats": [{
      "match_queue_name": "Solo",
      "match_queue_id": 474,
      "class_name": "Warrior",
      "class_id": 2594,
      "stats": {
           "games_played": 521,
           "kills_player": 371,
           "kills_bot": 6,
           "killing_spree_max": 5,
           "deaths": 479,
           "assists": 214,
           "duration_secs": 52100,
           "damage_player": 22019,
           "damage_taken": 4379,
           "damage_mitigated": 942,
           "healing_player": 249.999985,
           "healing_player_self": 663,
           "wins": 2,
           "losses": 519,
           "wards_mines_placed": 1098,
           "earned_xp": 157850,
           "earned_tokens": 442,
           "average_placement": 17,
           "placements": {"1": 2, "2": 4, "3": 3, "4": 3, "... 26": 0, "27": 1}
     }
  },
  {
      "match_queue_name": "Duo",
      "match_queue_id": 475,
      "class_name": "Warrior",
      "class_id": 2594,
      "stats": {
           "games_played": 521,
           "kills_player": 371,
           "kills_bot": 6,
           "killing_spree_max": 5,
           "deaths": 479,
           "assists": 214,
           "duration_secs": 52100,
           "damage_player": 22019,
           "damage_taken": 4379,
           "damage_mitigated": 942,
           "healing_player": 249.999985,
           "healing_player_self": 663,
           "wins": 2,
           "losses": 519,
           "wards_mines_placed": 1098,
           "earned_xp": 157850,
           "earned_tokens": 442,
           "average_placement": 17,
           "placements": {"1": 2, "2": 4, "3": 3, "4": 3, "... 26": 0, "27": 1}
     }
  }]        
}

Get Player Status

/GetPlayerStatus[ResponseFormat]/{devId}/{signature}/{session_id}/{timestamp}/{player}
Returns player online/offline status.

Parameter Description Example
ResponseFormat JSON or XML json
devID The devID from your Credentials 1004
signature The Signature of "getplayerstatus" method 7eb731fd427f950cd89b5a993decd9cb
session_id A valid session_id 1465AFCA32DBDB800CEF8C72F296C52C
timestamp The current Timestamp 20180628012612
player playerId (int) or playerName (string) RealmHero

Request: http://api.realmroyale.com/realmapi.svc/GetPlayerStatusJSON/1004/7eb731fd427f950cd89b5a993decd9cb/1465AFCA32DBDB800CEF8C72F296C52C/20180628012612/RealmHero

Response: JSON

{
	"match_id": 1181882,
	"personal_status_message": null,
	"status_id": 3,
	"status": "In Game",          
	"ret_msg": null
}

Get Player Match History

/GetPlayerMatchHistory[ResponseFormat]/{devId}/{signature}/{session_id}/{timestamp}/{player}
Returns high level data regarding matches played in the past 30 days. Limited to the 50 most recent matches.

Parameter Description Example
ResponseFormat JSON or XML json
devID The devID from your Credentials 1004
signature The Signature of "getplayermatchhistory" method 0eae1e63636000af32bf350606d8f0cf
session_id A valid session_id 1465AFCA32DBDB800CEF8C72F296C52C
timestamp The current Timestamp 20180628012612
player playerId (int) 123

Request: http://api.realmroyale.com/realmapi.svc/GetPlayerMatchHistoryJSON/1004/0eae1e63636000af32bf350606d8f0cf/1465AFCA32DBDB800CEF8C72F296C52C/20180628012612/123

Response: JSON

{
  "name": "RealmHero",
  "id": 123,
  "matches": [{
      "match_id": 526153,
      "match_datetime": "6\/14\/2018 5:14:27 PM",
      "match_duration_secs": 1243,
      "map_game": "LIVE Royale Map",
      "match_queue_name": "Duo",
      "match_queue_id": 475,
      "class_name": "Mage",
      "class_id": 2285,
      "team_id": 123828,
      "region": "Brazil",
      "gold": 0,
      "kills": 1,
      "creeps": 1,
      "assists": 0,
      "deaths": 1,
      "minutes": 8,
      "time_in_match_seconds": 513,
      "placement": 17,
      "damage": 2295,
      "damage_taken": 1949,
      "healing_player": 325,
      "healing_player_self": 308,
      "healing_bot": 0,          
      "killing_spree_max": 1,
      "damage_mitigated": 1500,
      "damage_done_in_hand": 300,          
      "wards_mines_placed": 94          
  }]     
}

Get Leaderboard

/GetLeaderboard[ResponseFormat]/{devId}/{signature}/{session_id}/{timestamp}/{queue}/{ranking_criteria}
Returns leaderboard information for a particular queue.

Parameter Description Example
ResponseFormat JSON or XML json
devID The devID from your Credentials 1004
signature The Signature of "getleaderboard" method ed37a2923b453df1d90f3c3b821da12d
session_id A valid session_id 1465AFCA32DBDB800CEF8C72F296C52C
timestamp The current Timestamp 20180628012612
queue Queue type 476
ranking_criteria 1: team_wins, 2: team_average_placement (shown below), 3: individual_average_kills, 4. win_rate, possibly/probably others as desired 1

Request: http://api.realmroyale.com/realmapi.svc/GetLeaderboardJSON/1004/ed37a2923b453df1d90f3c3b821da12d/1465AFCA32DBDB800CEF8C72F296C52C/20180628012612/476/1

Response: JSON

{         
    "queue_id": 476,
    "queue": "Quad",      
    "last_updated": "3\/18\/2018 5:14:27 PM",
    "leaderboard": [{
      "rank": 1,
      "player_name": "BestPlayer",
      "player_id": 1242243,
      "matches": 234,
      "team_wins": 15,
      "team_avg_placement": 5        
    },
    {
      "rank": 2,
      "player_name": "2ndBestPlayer",
      "player_id": 1242244,
      "matches": 423,
      "team_wins": 16,        
      "team_avg_placement": 5.1
    }],     
}

Get Match IDs By Queue

/GetMatchIDsByQueue[ResponseFormat]/{devId}/{signature}/{session_id}/{timestamp}/{queue}/{date}/{hour}
Returns all matchID values for a queue for a particular timeframe.

Parameter Description Example
ResponseFormat JSON or XML json
devID The devID from your Credentials 1004
signature The Signature of "getmatchidsbyqueue" method f5710889f18d346e6a8924fba9866074
session_id A valid session_id 1465AFCA32DBDB800CEF8C72F296C52C
timestamp The current Timestamp 20180628012612
queue Queue type 476
date
hour

Request: http://api.realmroyale.com/realmapi.svc/GetMatchIDsByQueueJSON/1004/f5710889f18d346e6a8924fba9866074/1465AFCA32DBDB800CEF8C72F296C52C/20180628012612/{queue}/{date}/{hour}

Response: JSON

{
	"active_flag": "n",
	"match": 1793874
}

Get Match Details

/GetMatchDetails[ResponseFormat]/{devId}/{signature}/{session_id}/{timestamp}/{matchId}
Returns end of match stats for a particular match. Intra-match stats aren't available.

Parameter Description Example
ResponseFormat JSON or XML json
devID The devID from your Credentials 1004
signature The Signature of "getmatchdetails" method 5a20182894eff801b627cfe89681f6ac
session_id A valid session_id 1465AFCA32DBDB800CEF8C72F296C52C
timestamp The current Timestamp 20180628012612
matchId A valid match_id 1793874

Request: http://api.realmroyale.com/realmapi.svc/GetMatchDetailsJSON/1004/5a20182894eff801b627cfe89681f6ac/1465AFCA32DBDB800CEF8C72F296C52C/20180628012612/1793874

Response: JSON

{   
    "match_id": 1793874,
    "region": "Europe",
    "queue_id": 476,
    "queue": "Quad",
    "duration_secs": 1805,
    "teams": [{
      "id": 383773,
      "placement": 1,
      "players": [{
          "name": "1stPlayer",
          "id": 3987123,
          "level": 22,
          "kills_player": 2,
          "kills_bot": 1,
          "assists": 1,
          "deaths": 1,
          "damage_player": 3361,
          "healing_player": 249.999985,            
          "duration_secs": 1422,
          "damage_taken": 344,
          "killing_spree_max": 11,
          "dropped_out_flag": 0,
          "healing_player_self": 284,
          "damage_mitigated": 450,
          "class_name": "Warrior",
          "class_id": 2594,
          "damage_done_in_hand": 1231,
          "mines_wards_placed": 96,
          "earned_xp": 27100,
          "earned_tokens": 177
       }],  
    }],     
}