api.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. <?php
  2. /**
  3. * @var mixed[] $API API help structure.
  4. */
  5. $API = [
  6. "version" => 2,
  7. "category" => [
  8. [ // BEGIN CATEGORY Profile
  9. "name" => "Profile",
  10. "command" => [
  11. [ // BEGIN COMMAND UploadProfile
  12. "name" => "UploadProfile",
  13. "type" => "POST",
  14. "url" => "/upload_profile/",
  15. "description" => "Upload and refreshes a player profile.",
  16. "parameter" => [
  17. [
  18. "key" => "key",
  19. "type" => "int",
  20. "description" => "User API key.",
  21. "optional" => false
  22. ],
  23. [
  24. "key" => "data",
  25. "type" => "string",
  26. "description" => "Response received from server on HubUserLogin.",
  27. "optional" => false
  28. ]
  29. ],
  30. "success" =>[
  31. [
  32. "status" => "204",
  33. "description" => "Profile hast been uploaded",
  34. "example" => null
  35. ]
  36. ],
  37. "error" =>[
  38. [
  39. "status" => "400",
  40. "description" => "Data could not be parsed.",
  41. "example" => null
  42. ],
  43. [
  44. "status" => "401",
  45. "description" => "Player doesn't exist or an invalid API key was provided.",
  46. "example" => null
  47. ]
  48. ]
  49. ] // END COMMAND UploadProfile
  50. ]
  51. ], // END CATEGORY Profile
  52. [ // BEGIN CATEGORY Unit
  53. "name" => "Units",
  54. "command" => [
  55. [ // BEGIN COMMAND GetUnits
  56. "name" => "GetUnits",
  57. "type" => "GET",
  58. "url" => "/units/<player_id>/",
  59. "description" => "Request Player's unit list.",
  60. "parameter" => [
  61. [
  62. "key" => "player_id",
  63. "type" => "int",
  64. "description" => "Unique player ID.",
  65. "optional" => false
  66. ],
  67. [
  68. "key" => "key",
  69. "type" => "int",
  70. "description" => "API key. Mandatory for private users.",
  71. "optional" => true
  72. ]
  73. ],
  74. "success" =>[
  75. [
  76. "status" => "200",
  77. "description" => "JSON formatted unit list, with ID and URL.",
  78. "example" => json_encode('[{"id":6275532969,"uri":"/API/v2/units/8114048/6275532969"},{"id":6275661927,"uri":"/API/v2/units/8114048/6275661927"}]', JSON_PRETTY_PRINT),
  79. ],
  80. [
  81. "status" => "204",
  82. "description" => "The player has no units",
  83. "example" => null
  84. ],
  85. ],
  86. "error" =>[
  87. [
  88. "status" => "400",
  89. "description" => "No user ID specified",
  90. "example" => null
  91. ],
  92. [
  93. "status" => "401",
  94. "description" => "Player doesn't exist or player is private and no (or invalid) API key was provided.",
  95. "example" => null
  96. ]
  97. ]
  98. ], // END COMMAND GetUnits
  99. [ // BEGIN COMMAND UnitDetails
  100. "name" => "UnitDetails",
  101. "type" => "GET",
  102. "url" => "/units/<player_id>/<unit_id>",
  103. "description" => "Request unit details.",
  104. "parameter" => [
  105. [
  106. "key" => "player_id",
  107. "type" => "int",
  108. "description" => "Unique player ID.",
  109. "optional" => false
  110. ],
  111. [
  112. "key" => "unit_id",
  113. "type" => "int",
  114. "description" => "Unique unit ID.",
  115. "optional" => false
  116. ],
  117. [
  118. "key" => "key",
  119. "type" => "int",
  120. "description" => "API key. Mandatory for private users.",
  121. "optional" => true
  122. ]
  123. ],
  124. "success" =>[
  125. [
  126. "status" => "200",
  127. "description" => "JSON formatted unit list, with ID and URL.",
  128. "example" => json_encode('{"uid":8114048,"id":6275661927,"building":0,"unit":19811,"level":40,"stars":6,"hp":9885,"attack":736,"defense":582,"speed":90,"crit_rate":15,"crit_damage":50,"resistance":15,"accuracy":0,"experience":1005420,"exp_gained":0,"exp_gain_rate":0,"costume":0,"source":26,"create_time":"2018-08-0106:11:05","homunculus_name":"","lock":1,"runes":[{"id":14799423798,"type":17,"slot":1,"stars":6,"ancient":0,"level":12,"quality":5,"original_quality":3,"value":32251,"efficiency":69.61666666666667,"max_efficiency":69.61666666666667,"main_stat":3,"main_stat_value":118,"innate_stat":null,"innate_stat_value":0,"substat_1":8,"substat_1_value":12,"substat_1_enchant":0,"substat_1_grind":0,"substat_2":11,"substat_2_value":9,"substat_2_enchant":0,"substat_2_grind":0,"substat_3":9,"substat_3_value":6,"substat_3_enchant":0,"substat_3_grind":0,"substat_4":1,"substat_4_value":233,"substat_4_enchant":0,"substat_4_grind":0},{"id":13751864646,"type":11,"slot":2,"stars":6,"ancient":0,"level":15,"quality":5,"original_quality":3,"value":33949,"efficiency":72.73809523809524,"max_efficiency":72.73809523809524,"main_stat":8,"main_stat_value":42,"innate_stat":null,"innate_stat_value":0,"substat_1":9,"substat_1_value":11,"substat_1_enchant":0,"substat_1_grind":0,"substat_2":2,"substat_2_value":12,"substat_2_enchant":0,"substat_2_grind":0,"substat_3":4,"substat_3_value":8,"substat_3_enchant":1,"substat_3_grind":4,"substat_4":3,"substat_4_value":17,"substat_4_enchant":0,"substat_4_grind":0},{"id":14899061711,"type":11,"slot":3,"stars":6,"ancient":0,"level":15,"quality":5,"original_quality":5,"value":25461,"efficiency":82.14285714285714,"max_efficiency":82.14285714285714,"main_stat":5,"main_stat_value":160,"innate_stat":null,"innate_stat_value":0,"substat_1":11,"substat_1_value":16,"substat_1_enchant":0,"substat_1_grind":0,"substat_2":9,"substat_2_value":6,"substat_2_enchant":0,"substat_2_grind":0,"substat_3":2,"substat_3_value":15,"substat_3_enchant":0,"substat_3_grind":0,"substat_4":12,"substat_4_value":13,"substat_4_enchant":0,"substat_4_grind":0},{"id":13287836357,"type":11,"slot":4,"stars":5,"ancient":0,"level":12,"quality":5,"original_quality":3,"value":18059,"efficiency":62.84013605442177,"max_efficiency":62.84013605442177,"main_stat":2,"main_stat_value":37,"innate_stat":4,"innate_stat_value":7,"substat_1":11,"substat_1_value":11,"substat_1_enchant":0,"substat_1_grind":0,"substat_2":6,"substat_2_value":11,"substat_2_enchant":0,"substat_2_grind":0,"substat_3":12,"substat_3_value":5,"substat_3_enchant":0,"substat_3_grind":0,"substat_4":9,"substat_4_value":3,"substat_4_enchant":0,"substat_4_grind":0},{"id":16006183006,"type":17,"slot":5,"stars":6,"ancient":0,"level":12,"quality":5,"original_quality":4,"value":29875,"efficiency":83.20578231292517,"max_efficiency":83.20578231292517,"main_stat":1,"main_stat_value":1800,"innate_stat":9,"innate_stat_value":4,"substat_1":6,"substat_1_value":22,"substat_1_enchant":0,"substat_1_grind":0,"substat_2":4,"substat_2_value":13,"substat_2_enchant":0,"substat_2_grind":0,"substat_3":2,"substat_3_value":6,"substat_3_enchant":0,"substat_3_grind":0,"substat_4":10,"substat_4_value":6,"substat_4_enchant":0,"substat_4_grind":0},{"id":17822905595,"type":11,"slot":6,"stars":6,"ancient":0,"level":15,"quality":5,"original_quality":3,"value":28856,"efficiency":74.40476190476191,"max_efficiency":74.40476190476191,"main_stat":4,"main_stat_value":63,"innate_stat":null,"innate_stat_value":0,"substat_1":8,"substat_1_value":6,"substat_1_enchant":0,"substat_1_grind":0,"substat_2":9,"substat_2_value":16,"substat_2_enchant":0,"substat_2_grind":0,"substat_3":2,"substat_3_value":7,"substat_3_enchant":0,"substat_3_grind":0,"substat_4":12,"substat_4_value":7,"substat_4_enchant":0,"substat_4_grind":0}],"skills":[{"skill":10606,"level":3},{"skill":10611,"level":5},{"skill":10616,"level":5}]}', JSON_PRETTY_PRINT),
  129. ]
  130. ],
  131. "error" =>[
  132. [
  133. "status" => "400",
  134. "description" => "No user ID specified",
  135. "example" => null
  136. ],
  137. [
  138. "status" => "401",
  139. "description" => "Player doesn't exist or player is private and no (or invalid) API key was provided.",
  140. "example" => null
  141. ],
  142. [
  143. "status" => "404",
  144. "description" => "Specified unit doesn't exists or it doesn't belong to the player.",
  145. "example" => null
  146. ]
  147. ]
  148. ], // END COMMAND GetUnits
  149. ]
  150. ], // END CATEGORY Unit
  151. [ // BEGIN CATEGORY Run
  152. "name" => "Runs",
  153. "command" => [
  154. [ // BEGIN COMMAND UploadRunDungeon
  155. "name" => "UploadRunDungeon",
  156. "type" => "POST",
  157. "url" => "/upload_run_dungeon/",
  158. "description" => "Registers a Cairos Dungeon run.",
  159. "parameter" => [
  160. [
  161. "key" => "key",
  162. "type" => "int",
  163. "description" => "User API key.",
  164. "optional" => false
  165. ],
  166. [
  167. "key" => "request",
  168. "type" => "string",
  169. "description" => "Intercepted request, as sent to server on BattleDungeonResult command.",
  170. "optional" => false
  171. ],
  172. [
  173. "key" => "response",
  174. "type" => "string",
  175. "description" => "Intercepted response, as received from server on BattleDungeonResult command.",
  176. "optional" => false
  177. ]
  178. ],
  179. "success" =>[
  180. [
  181. "status" => "201",
  182. "description" => "The run has been registered",
  183. "example" => null
  184. ]
  185. ],
  186. "error" =>[
  187. [
  188. "status" => "400",
  189. "description" => "Data could not be parsed.",
  190. "example" => null
  191. ],
  192. [
  193. "status" => "401",
  194. "description" => "Player doesn't exist or an invalid API key was provided.",
  195. "example" => null
  196. ],
  197. [
  198. "status" => "409",
  199. "description" => "The run is already logged.",
  200. "example" => null
  201. ]
  202. ]
  203. ], // END COMMAND UploadRunDungeon
  204. [ // BEGIN COMMAND UploadRunScenario
  205. "name" => "UploadRunDungeon",
  206. "type" => "POST",
  207. "url" => "/upload_run_scenario/",
  208. "description" => "Registers a Scenario run.",
  209. "parameter" => [
  210. [
  211. "key" => "key",
  212. "type" => "int",
  213. "description" => "User API key.",
  214. "optional" => false
  215. ],
  216. [
  217. "key" => "request",
  218. "type" => "string",
  219. "description" => "Intercepted request, as sent to server on BattleScenarioResult command.",
  220. "optional" => false
  221. ],
  222. [
  223. "key" => "response",
  224. "type" => "string",
  225. "description" => "Intercepted response, as received from server on BattleScenarioResult command.",
  226. "optional" => false
  227. ]
  228. ],
  229. "success" =>[
  230. [
  231. "status" => "201",
  232. "description" => "The run has been registered",
  233. "example" => null
  234. ]
  235. ],
  236. "error" =>[
  237. [
  238. "status" => "400",
  239. "description" => "Data could not be parsed.",
  240. "example" => null
  241. ],
  242. [
  243. "status" => "401",
  244. "description" => "Player doesn't exist or an invalid API key was provided.",
  245. "example" => null
  246. ],
  247. [
  248. "status" => "409",
  249. "description" => "The run is already logged.",
  250. "example" => null
  251. ]
  252. ]
  253. ], // END COMMAND UploadRunScenario
  254. [ // BEGIN COMMAND UploadRunDimension
  255. "name" => "UploadRunDimension",
  256. "type" => "POST",
  257. "url" => "/upload_run_dimension/",
  258. "description" => "Registers a Dimensional Hole Dungeon run.",
  259. "parameter" => [
  260. [
  261. "key" => "key",
  262. "type" => "int",
  263. "description" => "User API key.",
  264. "optional" => false
  265. ],
  266. [
  267. "key" => "request",
  268. "type" => "string",
  269. "description" => "Intercepted request, as sent to server on BattleDimensionHoleDungeonResult command.",
  270. "optional" => false
  271. ],
  272. [
  273. "key" => "response",
  274. "type" => "string",
  275. "description" => "Intercepted response, as received from server on BattleDimensionHoleDungeonResult command.",
  276. "optional" => false
  277. ]
  278. ],
  279. "success" =>[
  280. [
  281. "status" => "201",
  282. "description" => "The run has been registered",
  283. "example" => null
  284. ]
  285. ],
  286. "error" =>[
  287. [
  288. "status" => "400",
  289. "description" => "Data could not be parsed.",
  290. "example" => null
  291. ],
  292. [
  293. "status" => "401",
  294. "description" => "Player doesn't exist or an invalid API key was provided.",
  295. "example" => null
  296. ],
  297. [
  298. "status" => "409",
  299. "description" => "The run is already logged.",
  300. "example" => null
  301. ]
  302. ]
  303. ], // END COMMAND UploadRunDimension
  304. [ // BEGIN COMMAND UploadRunTOA
  305. "name" => "UploadRunTOA",
  306. "type" => "POST",
  307. "url" => "/upload_run_toa/",
  308. "description" => "Registers a TOA run.",
  309. "parameter" => [
  310. [
  311. "key" => "key",
  312. "type" => "int",
  313. "description" => "User API key.",
  314. "optional" => false
  315. ],
  316. [
  317. "key" => "request",
  318. "type" => "string",
  319. "description" => "Intercepted request, as sent to server on BattleTrialTowerResult_v2 command.",
  320. "optional" => false
  321. ],
  322. [
  323. "key" => "response",
  324. "type" => "string",
  325. "description" => "Intercepted response, as received from server on BattleTrialTowerResult_v2 command.",
  326. "optional" => false
  327. ]
  328. ],
  329. "success" =>[
  330. [
  331. "status" => "201",
  332. "description" => "The run has been registered",
  333. "example" => null
  334. ]
  335. ],
  336. "error" =>[
  337. [
  338. "status" => "400",
  339. "description" => "Data could not be parsed.",
  340. "example" => null
  341. ],
  342. [
  343. "status" => "401",
  344. "description" => "Player doesn't exist or an invalid API key was provided.",
  345. "example" => null
  346. ],
  347. [
  348. "status" => "409",
  349. "description" => "The run is already logged.",
  350. "example" => null
  351. ]
  352. ]
  353. ], // END COMMAND UploadRunTOA
  354. ]
  355. ], // END CATEGORY Run
  356. ],
  357. ];
  358. ?>