api.php 21 KB

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