{"id":388,"date":"2019-07-10T23:35:18","date_gmt":"2019-07-11T03:35:18","guid":{"rendered":"http:\/\/ninecrows.com\/pandamallet\/?p=388"},"modified":"2019-07-10T12:06:44","modified_gmt":"2019-07-10T16:06:44","slug":"cluster-restful-apis","status":"publish","type":"post","link":"https:\/\/ninecrows.com\/pandamallet\/2019\/07\/10\/cluster-restful-apis\/","title":{"rendered":"Cluster &#8211; RESTful APIs"},"content":{"rendered":"\n<p>As part of building the front-end to the shared web side aspect of the cluster game, I&#8217;m starting to lay out the RESTful interface to the database at the back-end of the server side.<\/p>\n\n\n\n<p>I&#8217;m looking at several main categories using query parameters to filter results on aggregate areas.<\/p>\n\n\n\n<ul><li>players<br><em fgid=\"18963\">Returns a list of player names and ids. Details of a specific player can be retrieved (and changed) by accessing the player by player id as a sub-resource. Permissions do  apply here&#8230;a normal player can only view or edit the details for their own information. An administrator can view and change information for any player.<\/em><ul fgid=\"36431\"><li>id (immutable after creation)<\/li><li>name &#8211; Unique, human readable user name<\/li><li> email <\/li><li>is email public<\/li><li>password (settable only)<\/li><li>active<\/li><li>date joined <\/li><li>date last activity<\/li><\/ul><\/li><li>games<br><em fgid=\"39554\">Returns a list of games in the database. With query parameters this can return games containing only a selected player or players, games that are in progress and perhaps other subsets of all stored games. Details of a specific game may be retrieved by game id. For normal players, only the details that their player identity has access to may be retrieved. For developers all details are visible and subject to modification.<\/em><ul fgid=\"40353\"><li>id<\/li><li>player ids<\/li><li>turns<br><em fgid=\"43962\">One entry for each turn in the game so far.  All open if the game is completed otherwise only information visible to this user is present.<\/em><ul fgid=\"44748\"><li>turn number<\/li><li>units list<ul fgid=\"45940\"><li>unit id<\/li><li>unit type<br><em fgid=\"46411\">ship type, planetary resource type, population<\/em><\/li><li>location type<br><em fgid=\"46962\">space or system or planet<\/em><\/li><li>location<\/li><li>player id<\/li><\/ul><\/li><li>technology list<ul fgid=\"48614\"><li>players<ul fgid=\"49060\"><li>player id<\/li><li>technology id<\/li><li>level<\/li><li>investment<\/li><\/ul><\/li><\/ul><\/li><li>moves list<ul fgid=\"48632\"><li>players<ul fgid=\"48632\"><li><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/li><li>current turn<\/li><li>moves submitted<br>(may be part of the turns container)<\/li><li>active<\/li><li>created<\/li><li>completed<\/li><li>final scores if completed<\/li><li>stars<\/li><\/ul><\/li><li>options<br><em fgid=\"40373\">Options that relate to new games being started. Global lists (start information, admiral information<\/em> and such). Generally these will only impact newly created games. Selected items may affect all games.<\/li><li>audit<br><em fgid=\"35363\">Audit log recording changes made using administrative privileges. <\/em><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>As part of building the front-end to the shared web side aspect of the cluster game, I&#8217;m starting to lay out the RESTful interface to the database at the back-end of the server side. I&#8217;m looking at several main categories using query parameters to filter results on aggregate areas. playersReturns a list of player names &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/ninecrows.com\/pandamallet\/2019\/07\/10\/cluster-restful-apis\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Cluster &#8211; RESTful APIs&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[20,19],"tags":[],"_links":{"self":[{"href":"https:\/\/ninecrows.com\/pandamallet\/wp-json\/wp\/v2\/posts\/388"}],"collection":[{"href":"https:\/\/ninecrows.com\/pandamallet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ninecrows.com\/pandamallet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ninecrows.com\/pandamallet\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ninecrows.com\/pandamallet\/wp-json\/wp\/v2\/comments?post=388"}],"version-history":[{"count":3,"href":"https:\/\/ninecrows.com\/pandamallet\/wp-json\/wp\/v2\/posts\/388\/revisions"}],"predecessor-version":[{"id":391,"href":"https:\/\/ninecrows.com\/pandamallet\/wp-json\/wp\/v2\/posts\/388\/revisions\/391"}],"wp:attachment":[{"href":"https:\/\/ninecrows.com\/pandamallet\/wp-json\/wp\/v2\/media?parent=388"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ninecrows.com\/pandamallet\/wp-json\/wp\/v2\/categories?post=388"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ninecrows.com\/pandamallet\/wp-json\/wp\/v2\/tags?post=388"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}