{"action":"created","comment":{"url":"https://api.github.com/repos/lightvector/arimaa-server/pulls/comments/32590393","id":32590393,"diff_hunk":"@@ -0,0 +1,128 @@\n+\n+################################################################################\n+Arimaa Game Server JSON API\n+################################################################################\n+\n+#TODO - see todos below\n+\n+All requests and responses are in JSON.\n+\n+Shared types:\n+<Message> = {\"message\":<String>}\n+<Error> = {\"error\":<String>}\n+<GameID> = <Int>   #Identifier for a game\n+<Auth> = <String>  #Authorization token returned from logging in\n+<GameAuth> = <String>  #Authorization token returned from joining a game\n+<Username> = <String>\n+<Timestamp> = <Float> #Seconds since the epoch (1970-01-01 00:00 UTC) (up to however much precision the server has)\n+\n+===ACCOUNTS========================================================\n+To register an account:\n+POST /accounts/register {\"username\":<Username>,\"email\":<String>,\"password\":<String>}\n+\n+#TODO add other account facilities\n+#TODO add ways of looking up users\n+\n+===LOGIN===========================================================\n+To log in:\n+POST /accounts/login {\"username\":<Username>,\"password\":<String>}\n+Response if successful = {\"username\":<Username>,\"auth\":<Auth>}\n+Response if not successful = <Error>\n+\n+To log out:\n+POST /accounts/logout {\"auth\":<Auth>}\n+Response if successful = <Message>\n+Response if not successful = <Error>\n+\n+===GAMEROOM========================================================\n+<Board> = {\n+  \"history\":[<String>,<String>,<String>,...], #Move history in the order [1g,1s,2g,2s...] ex: [\"Ra1\",\"Ra7\",\"Ra1n Ra2n Ra3n Ra4n\"]\n+  \"toMove\":<String>,  #Next player to move, either \"g\" or \"s\"\n+  \"position\":<String> #64-char string specifying the board in the order a8-h8,a7-h7,...,a1-h1\n+                      #ex:\"rrrrrrrrchdemdhc                                CHDMEDHCRRRRRRRR\"\n+}\n+\n+<UserInfo> = {\n+  \"username\":<Username>,\n+  \"rating\":<Float>\n+}\n+\n+<GameResult> = {\n+  \"resultCode\":<String>, #TODO - describe this. Same as current Arimaa resultCode system seems okay\n+  \"endTime\":<Timestamp>\n+}\n+\n+<PlayerTimeControl> = {\n+  #TODO - probably just adopt the current arimaa time control system or something similar\n+}\n+\n+<GameMetadata> = {\n+  \"id\":<Int>,\n+  \"numMoves\":<Int>, #Total number of moves made in the game (ex: {1g, 1s, 2g, 2s, 3g} = 5 moves)","path":"api_draft.txt","position":61,"original_position":61,"commit_id":"2cac89f9b137f1502a052cfde4647c768ece27ce","original_commit_id":"2cac89f9b137f1502a052cfde4647c768ece27ce","user":{"login":"lightvector","id":11942395,"avatar_url":"https://avatars.githubusercontent.com/u/11942395?v=3","gravatar_id":"","url":"https://api.github.com/users/lightvector","html_url":"https://github.com/lightvector","followers_url":"https://api.github.com/users/lightvector/followers","following_url":"https://api.github.com/users/lightvector/following{/other_user}","gists_url":"https://api.github.com/users/lightvector/gists{/gist_id}","starred_url":"https://api.github.com/users/lightvector/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lightvector/subscriptions","organizations_url":"https://api.github.com/users/lightvector/orgs","repos_url":"https://api.github.com/users/lightvector/repos","events_url":"https://api.github.com/users/lightvector/events{/privacy}","received_events_url":"https://api.github.com/users/lightvector/received_events","type":"User","site_admin":false},"body":"Okay, let's use the word \"ply\", which is the word that refers precisely to the concept desired here. @mattj256 - tell me if you strongly object.","created_at":"2015-06-17T02:08:57Z","updated_at":"2015-06-17T02:08:57Z","html_url":"https://github.com/lightvector/arimaa-server/pull/32#discussion_r32590393","pull_request_url":"https://api.github.com/repos/lightvector/arimaa-server/pulls/32","_links":{"self":{"href":"https://api.github.com/repos/lightvector/arimaa-server/pulls/comments/32590393"},"html":{"href":"https://github.com/lightvector/arimaa-server/pull/32#discussion_r32590393"},"pull_request":{"href":"https://api.github.com/repos/lightvector/arimaa-server/pulls/32"}}},"pull_request":{"url":"https://api.github.com/repos/lightvector/arimaa-server/pulls/32","id":37630043,"html_url":"https://github.com/lightvector/arimaa-server/pull/32","diff_url":"https://github.com/lightvector/arimaa-server/pull/32.diff","patch_url":"https://github.com/lightvector/arimaa-server/pull/32.patch","issue_url":"https://api.github.com/repos/lightvector/arimaa-server/issues/32","number":32,"state":"open","locked":false,"title":"Add partial API draft","user":{"login":"lightvector","id":11942395,"avatar_url":"https://avatars.githubusercontent.com/u/11942395?v=3","gravatar_id":"","url":"https://api.github.com/users/lightvector","html_url":"https://github.com/lightvector","followers_url":"https://api.github.com/users/lightvector/followers","following_url":"https://api.github.com/users/lightvector/following{/other_user}","gists_url":"https://api.github.com/users/lightvector/gists{/gist_id}","starred_url":"https://api.github.com/users/lightvector/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lightvector/subscriptions","organizations_url":"https://api.github.com/users/lightvector/orgs","repos_url":"https://api.github.com/users/lightvector/repos","events_url":"https://api.github.com/users/lightvector/events{/privacy}","received_events_url":"https://api.github.com/users/lightvector/received_events","type":"User","site_admin":false},"body":"Not complete, but opening this up anyways so that we can begin to get some comments. If something is silly or poorly designed below, don't hesitate to say so. Happy to talk further.\r\n\r\nAs it stands, I believe this API is not completely conforming to the REST philosophy regarding resource path names, and also due to the choice of how to do authentication. But I hope the choices are reasonable nonetheless.\r\n","created_at":"2015-06-13T19:28:29Z","updated_at":"2015-06-17T02:08:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3adfdf528c45f86fcd6e0cfb8da3346448fa9dda","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/lightvector/arimaa-server/pulls/32/commits","review_comments_url":"https://api.github.com/repos/lightvector/arimaa-server/pulls/32/comments","review_comment_url":"https://api.github.com/repos/lightvector/arimaa-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lightvector/arimaa-server/issues/32/comments","statuses_url":"https://api.github.com/repos/lightvector/arimaa-server/statuses/2cac89f9b137f1502a052cfde4647c768ece27ce","head":{"label":"lightvector:iss30","ref":"iss30","sha":"2cac89f9b137f1502a052cfde4647c768ece27ce","user":{"login":"lightvector","id":11942395,"avatar_url":"https://avatars.githubusercontent.com/u/11942395?v=3","gravatar_id":"","url":"https://api.github.com/users/lightvector","html_url":"https://github.com/lightvector","followers_url":"https://api.github.com/users/lightvector/followers","following_url":"https://api.github.com/users/lightvector/following{/other_user}","gists_url":"https://api.github.com/users/lightvector/gists{/gist_id}","starred_url":"https://api.github.com/users/lightvector/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lightvector/subscriptions","organizations_url":"https://api.github.com/users/lightvector/orgs","repos_url":"https://api.github.com/users/lightvector/repos","events_url":"https://api.github.com/users/lightvector/events{/privacy}","received_events_url":"https://api.github.com/users/lightvector/received_events","type":"User","site_admin":false},"repo":{"id":35457293,"name":"arimaa-server","full_name":"lightvector/arimaa-server","owner":{"login":"lightvector","id":11942395,"avatar_url":"https://avatars.githubusercontent.com/u/11942395?v=3","gravatar_id":"","url":"https://api.github.com/users/lightvector","html_url":"https://github.com/lightvector","followers_url":"https://api.github.com/users/lightvector/followers","following_url":"https://api.github.com/users/lightvector/following{/other_user}","gists_url":"https://api.github.com/users/lightvector/gists{/gist_id}","starred_url":"https://api.github.com/users/lightvector/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lightvector/subscriptions","organizations_url":"https://api.github.com/users/lightvector/orgs","repos_url":"https://api.github.com/users/lightvector/repos","events_url":"https://api.github.com/users/lightvector/events{/privacy}","received_events_url":"https://api.github.com/users/lightvector/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lightvector/arimaa-server","description":"Arimaa server","fork":false,"url":"https://api.github.com/repos/lightvector/arimaa-server","forks_url":"https://api.github.com/repos/lightvector/arimaa-server/forks","keys_url":"https://api.github.com/repos/lightvector/arimaa-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lightvector/arimaa-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lightvector/arimaa-server/teams","hooks_url":"https://api.github.com/repos/lightvector/arimaa-server/hooks","issue_events_url":"https://api.github.com/repos/lightvector/arimaa-server/issues/events{/number}","events_url":"https://api.github.com/repos/lightvector/arimaa-server/events","assignees_url":"https://api.github.com/repos/lightvector/arimaa-server/assignees{/user}","branches_url":"https://api.github.com/repos/lightvector/arimaa-server/branches{/branch}","tags_url":"https://api.github.com/repos/lightvector/arimaa-server/tags","blobs_url":"https://api.github.com/repos/lightvector/arimaa-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lightvector/arimaa-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lightvector/arimaa-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/lightvector/arimaa-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lightvector/arimaa-server/statuses/{sha}","languages_url":"https://api.github.com/repos/lightvector/arimaa-server/languages","stargazers_url":"https://api.github.com/repos/lightvector/arimaa-server/stargazers","contributors_url":"https://api.github.com/repos/lightvector/arimaa-server/contributors","subscribers_url":"https://api.github.com/repos/lightvector/arimaa-server/subscribers","subscription_url":"https://api.github.com/repos/lightvector/arimaa-server/subscription","commits_url":"https://api.github.com/repos/lightvector/arimaa-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/lightvector/arimaa-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/lightvector/arimaa-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/lightvector/arimaa-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/lightvector/arimaa-server/contents/{+path}","compare_url":"https://api.github.com/repos/lightvector/arimaa-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lightvector/arimaa-server/merges","archive_url":"https://api.github.com/repos/lightvector/arimaa-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lightvector/arimaa-server/downloads","issues_url":"https://api.github.com/repos/lightvector/arimaa-server/issues{/number}","pulls_url":"https://api.github.com/repos/lightvector/arimaa-server/pulls{/number}","milestones_url":"https://api.github.com/repos/lightvector/arimaa-server/milestones{/number}","notifications_url":"https://api.github.com/repos/lightvector/arimaa-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lightvector/arimaa-server/labels{/name}","releases_url":"https://api.github.com/repos/lightvector/arimaa-server/releases{/id}","created_at":"2015-05-12T00:18:58Z","updated_at":"2015-05-13T03:50:50Z","pushed_at":"2015-06-16T03:30:15Z","git_url":"git://github.com/lightvector/arimaa-server.git","ssh_url":"git@github.com:lightvector/arimaa-server.git","clone_url":"https://github.com/lightvector/arimaa-server.git","svn_url":"https://github.com/lightvector/arimaa-server","homepage":null,"size":33706,"stargazers_count":1,"watchers_count":1,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":16,"forks":2,"open_issues":16,"watchers":1,"default_branch":"master"}},"base":{"label":"lightvector:master","ref":"master","sha":"de8214dcf1fd1f3aa8da088b2ea5f659acdfe5e0","user":{"login":"lightvector","id":11942395,"avatar_url":"https://avatars.githubusercontent.com/u/11942395?v=3","gravatar_id":"","url":"https://api.github.com/users/lightvector","html_url":"https://github.com/lightvector","followers_url":"https://api.github.com/users/lightvector/followers","following_url":"https://api.github.com/users/lightvector/following{/other_user}","gists_url":"https://api.github.com/users/lightvector/gists{/gist_id}","starred_url":"https://api.github.com/users/lightvector/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lightvector/subscriptions","organizations_url":"https://api.github.com/users/lightvector/orgs","repos_url":"https://api.github.com/users/lightvector/repos","events_url":"https://api.github.com/users/lightvector/events{/privacy}","received_events_url":"https://api.github.com/users/lightvector/received_events","type":"User","site_admin":false},"repo":{"id":35457293,"name":"arimaa-server","full_name":"lightvector/arimaa-server","owner":{"login":"lightvector","id":11942395,"avatar_url":"https://avatars.githubusercontent.com/u/11942395?v=3","gravatar_id":"","url":"https://api.github.com/users/lightvector","html_url":"https://github.com/lightvector","followers_url":"https://api.github.com/users/lightvector/followers","following_url":"https://api.github.com/users/lightvector/following{/other_user}","gists_url":"https://api.github.com/users/lightvector/gists{/gist_id}","starred_url":"https://api.github.com/users/lightvector/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lightvector/subscriptions","organizations_url":"https://api.github.com/users/lightvector/orgs","repos_url":"https://api.github.com/users/lightvector/repos","events_url":"https://api.github.com/users/lightvector/events{/privacy}","received_events_url":"https://api.github.com/users/lightvector/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lightvector/arimaa-server","description":"Arimaa server","fork":false,"url":"https://api.github.com/repos/lightvector/arimaa-server","forks_url":"https://api.github.com/repos/lightvector/arimaa-server/forks","keys_url":"https://api.github.com/repos/lightvector/arimaa-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lightvector/arimaa-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lightvector/arimaa-server/teams","hooks_url":"https://api.github.com/repos/lightvector/arimaa-server/hooks","issue_events_url":"https://api.github.com/repos/lightvector/arimaa-server/issues/events{/number}","events_url":"https://api.github.com/repos/lightvector/arimaa-server/events","assignees_url":"https://api.github.com/repos/lightvector/arimaa-server/assignees{/user}","branches_url":"https://api.github.com/repos/lightvector/arimaa-server/branches{/branch}","tags_url":"https://api.github.com/repos/lightvector/arimaa-server/tags","blobs_url":"https://api.github.com/repos/lightvector/arimaa-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lightvector/arimaa-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lightvector/arimaa-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/lightvector/arimaa-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lightvector/arimaa-server/statuses/{sha}","languages_url":"https://api.github.com/repos/lightvector/arimaa-server/languages","stargazers_url":"https://api.github.com/repos/lightvector/arimaa-server/stargazers","contributors_url":"https://api.github.com/repos/lightvector/arimaa-server/contributors","subscribers_url":"https://api.github.com/repos/lightvector/arimaa-server/subscribers","subscription_url":"https://api.github.com/repos/lightvector/arimaa-server/subscription","commits_url":"https://api.github.com/repos/lightvector/arimaa-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/lightvector/arimaa-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/lightvector/arimaa-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/lightvector/arimaa-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/lightvector/arimaa-server/contents/{+path}","compare_url":"https://api.github.com/repos/lightvector/arimaa-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lightvector/arimaa-server/merges","archive_url":"https://api.github.com/repos/lightvector/arimaa-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lightvector/arimaa-server/downloads","issues_url":"https://api.github.com/repos/lightvector/arimaa-server/issues{/number}","pulls_url":"https://api.github.com/repos/lightvector/arimaa-server/pulls{/number}","milestones_url":"https://api.github.com/repos/lightvector/arimaa-server/milestones{/number}","notifications_url":"https://api.github.com/repos/lightvector/arimaa-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lightvector/arimaa-server/labels{/name}","releases_url":"https://api.github.com/repos/lightvector/arimaa-server/releases{/id}","created_at":"2015-05-12T00:18:58Z","updated_at":"2015-05-13T03:50:50Z","pushed_at":"2015-06-16T03:30:15Z","git_url":"git://github.com/lightvector/arimaa-server.git","ssh_url":"git@github.com:lightvector/arimaa-server.git","clone_url":"https://github.com/lightvector/arimaa-server.git","svn_url":"https://github.com/lightvector/arimaa-server","homepage":null,"size":33706,"stargazers_count":1,"watchers_count":1,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":16,"forks":2,"open_issues":16,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lightvector/arimaa-server/pulls/32"},"html":{"href":"https://github.com/lightvector/arimaa-server/pull/32"},"issue":{"href":"https://api.github.com/repos/lightvector/arimaa-server/issues/32"},"comments":{"href":"https://api.github.com/repos/lightvector/arimaa-server/issues/32/comments"},"review_comments":{"href":"https://api.github.com/repos/lightvector/arimaa-server/pulls/32/comments"},"review_comment":{"href":"https://api.github.com/repos/lightvector/arimaa-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lightvector/arimaa-server/pulls/32/commits"},"statuses":{"href":"https://api.github.com/repos/lightvector/arimaa-server/statuses/2cac89f9b137f1502a052cfde4647c768ece27ce"}}}}