Difference between revisions of "External Services and Tools/API Documentation/realm"

From BattleMaster Wiki
Jump to navigation Jump to search
(Created page with "{{RightTOC}} Lists details about a particular realm. ==Parameters== {| style="background:#eee;" |- ! Parameter ! Type ! Meaning |-valign="top" | World | integer | Game world...")
 
 
Line 10: Line 10:
 
|-valign="top"
 
|-valign="top"
 
| World
 
| World
| integer
+
| integer/string
| Game world ID you access, see [[#World IDs]]
+
| Game world ID OR world name with first letters capitalized.
 
|-valign="top"
 
|-valign="top"
| ID
+
| ID or Name
| integer
+
| integer/string
| ID number of the realm in question. You can find this for example by examining the URL of the "Details" link on the Realm List page, or (if the page is already set up correctly) on the realm's page here in the wiki.  Can be replaced by Name.
+
| ID number or name of the realm in question.
|-valign="top"
 
| Name
 
| text/string
 
| Can replace ID.  Name of the Realm being queried.
 
 
|-valign="top"
 
|-valign="top"
 
| WithRegions
 
| WithRegions
Line 26: Line 22:
 
|}
 
|}
 
==Outputs==
 
==Outputs==
===XML===
+
{{API_RealmData}}
<realmdata>
 
    <continent> ''string'' </continent>
 
    <id> ''integer'' </id>
 
    <name> ''string'' </name>
 
    <fullname> ''string''</fullname>
 
    <colour> ''string'' </colour>
 
    <banner> ''string'' </banner>
 
    <system> ''string'' </system>
 
    <capital> ''integer'' </capital>
 
    <rulertitle> ''string'' </rulertitle>
 
    <rulername> ''string'' </rulername>
 
    <generaltitle> ''string'' </generaltitle>
 
    <generalname> ''string'' </generalname>
 
    <judgetitle> ''string'' </judgetitle>
 
    <judgename> ''string'' </judgename>
 
    <bankertitle> ''string'' </bankertitle>
 
    <bankername> ''string'' </bankername>
 
    <population> ''string'' </population>
 
    <gold> ''string'' </gold>
 
    <food> ''string'' </food>
 
    <regioncount> ''string'' </regioncount>
 
    <nobles> ''integer'' </nobles>
 
    <adventurers> ''integer'' </adventurers>
 
    <duchycount> ''integer'' </duchycount>
 
    <region-ids> ''comma-separated list of strings''</region-ids>
 
    <region-names> ''comma-separated list of strings''</region-names>
 
    <summary>''string''</summary>
 
    <theme>''comma-separated list of stings''</theme>
 
</realmdata>
 
=== JSON ===
 
{
 
    "realmdata": {
 
        "id": ''integer'',
 
        "continent": ''string'',
 
        "continentid": ''string'',
 
        "name": ''string'',
 
        "fullname": ''string'',
 
        "colour": ''string'',
 
        "banner": ''string'',
 
        "system": ''string'',
 
        "capital": ''string'',
 
        "rulertitle": ''string'',
 
        "rulername": ''string'',
 
        "generaltitle": ''string'',
 
        "generalname": ''string'',
 
        "judgetitle": ''string'',
 
        "judgename": ''string'',
 
        "bankertitle": ''string'',
 
        "bankername": ''string'',
 
        "population": ''string'',
 
        "gold": ''string'',
 
        "food": ''string'',
 
        "regioncount": ''string'',
 
        "nobles": ''integer'',
 
        "adventurers": ''integer'',
 
        "duchycount": ''integer'',
 
        "region-ids": ''comma-separated list of strings'',
 
        "region-names": ''comma-separated list of strings'',
 
        "summary": ''string'',
 
        "theme": ''comma-separated list of strings''
 
    }
 
}
 
 
=== Example ===
 
=== Example ===
 
; The Realm of Darka by ID : http://battlemaster.org/data/realm.php?World=2&ID=14
 
; The Realm of Darka by ID : http://battlemaster.org/data/realm.php?World=2&ID=14
 
; The Realm of Arcaea by name, with regions : http://battlemaster.org/data/realm.php?World=7&Name=Arcaea&WithRegions=True
 
; The Realm of Arcaea by name, with regions : http://battlemaster.org/data/realm.php?World=7&Name=Arcaea&WithRegions=True

Latest revision as of 09:43, 28 January 2022

Lists details about a particular realm.

Parameters

Parameter Type Meaning
World integer/string Game world ID OR world name with first letters capitalized.
ID or Name integer/string ID number or name of the realm in question.
WithRegions boolean optional - if given, a list of region IDs (for use in the region.php script) and region names is included. only use this if you need them, it is considerably more expensive on the database than without

Outputs

XML

<xml>
 <realmdata>
  <continent> string </continent>
  <id> integer </id>
  <name> string </name>
  <fullname> string</fullname>
  <colour> string </colour>
  <banner> string </banner>
  <system> string </system>
  <capital> integer </capital>
  <rulertitle> string </rulertitle>
  <rulername> string </rulername>
  <generaltitle> string </generaltitle>
  <generalname> string </generalname>
  <judgetitle> string </judgetitle>
  <judgename> string </judgename>
  <bankertitle> string </bankertitle>
  <bankername> string </bankername>
  <population> string </population>
  <gold> string </gold>
  <food> string </food>
  <regioncount> string </regioncount>
  <nobles> integer </nobles>
  <adventurers> integer </adventurers>
  <duchycount> integer </duchycount>
  <region-ids>
   comma separated value list
  </region-ids>
  <region-names>
   comma separated value list
  </region-names>
  <summary>string</summary>
  <theme>comma-separated list of stings</theme>
 </realmdata>
</xml>

JSON

{
   "realmdata": {
       "id": integer,
       "continent": string,
       "continentid": string,
       "name": string,
       "fullname": string,
       "colour": string,
       "banner": string,
       "system": string,
       "capital": string,
       "rulertitle": string,
       "rulername": string,
       "generaltitle": string,
       "generalname": string,
       "judgetitle": string,
       "judgename": string,
       "bankertitle": string,
       "bankername": string,
       "population": string,
       "gold": string,
       "food": string,
       "regioncount": string,
       "nobles": integer,
       "adventurers": integer,
       "duchycount": integer,
       "region-ids": comma separated value list,
       "region-names": comma separated value list
       "summary": string,
       "theme": comma-separated list of strings
   }
}

Example

The Realm of Darka by ID 
http://battlemaster.org/data/realm.php?World=2&ID=14
The Realm of Arcaea by name, with regions 
http://battlemaster.org/data/realm.php?World=7&Name=Arcaea&WithRegions=True