{"info":{"_postman_id":"dffd84c1-2864-463a-a8a4-e688f7638773","name":"Tic-Tac-Toe API","description":"<html><head></head><body><h1 id=\"introduction\">Introduction</h1>\n<p>This API allows you to play Tic-Tac-Toe. You and someone can play together, or you can play against a computer, either against one that uses random algorithm, or a computer that is impossible to win against which uses the minimax algorithm.</p>\n<p>I implemented this API on a react WebApp, try it out <a href=\"https://alkindi17.github.io/tictactoe/\">here</a> or visit <a href=\"https://github.com/alkindi17/tictactoe\">the github page</a>.</p>\n<h1 id=\"overview\">Overview</h1>\n<p>There are 3 types of requests:</p>\n<ol>\n<li><p>Create Session<br>POST - <a href=\"http://alkindi.pythonanywhere.com/session\">http://alkindi.pythonanywhere.com/session</a></p>\n</li>\n<li><p>Get Session Details<br>GET - <a href=\"http://alkindi.pythonanywhere.com/session\">http://alkindi.pythonanywhere.com/session</a></p>\n</li>\n<li><p>Play; make a move<br>POST - <a href=\"http://alkindi.pythonanywhere.com/session/play\">http://alkindi.pythonanywhere.com/session/play</a></p>\n</li>\n</ol>\n<h1 id=\"status-codes\">Status Codes</h1>\n<p>Status 200: Success.<br>Status 400: Something wrong with your request.<br>Status 500: Something wrong with the server.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"Introduction","slug":"introduction"},{"content":"Overview","slug":"overview"},{"content":"Status Codes","slug":"status-codes"}],"owner":"25468658","collectionId":"dffd84c1-2864-463a-a8a4-e688f7638773","publishedId":"2s8ZDeSy5r","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2023-01-26T19:43:59.000Z"},"item":[{"name":"http://alkindi.pythonanywhere.com/session","id":"646c54e5-c8ef-47ba-abcb-4859653fe882","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"player_x\" : \"human\",\n    \"player_o\" : \"random\",\n    \"start\" : \"x\"\n}","options":{"raw":{"language":"json"}}},"url":"http://alkindi.pythonanywhere.com/session","description":"<p><strong>Create a new tic-tac-toe game session</strong></p>\n<p>the request body parameter are:</p>\n<ul>\n<li><strong>player_x</strong>: accepts \"human\", \"random\", \"minimax\".</li>\n<li><strong>player_o</strong>: accepts \"human\", \"random\", \"minimax\".</li>\n<li><strong>start</strong>: accepts \"x\", \"o\".</li>\n</ul>\n<p>the response body :</p>\n<ul>\n<li><strong>game_board</strong>: a list of the cells in the sessions's tic-tac-toe board; [0,1,2,3,4,5,6,7,8], empty items will contain the index of the item, and occupied items will contain either 'x' or 'o'.</li>\n</ul>\n<p>Guide:</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>0</th>\n<th>1</th>\n<th>2</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>3</td>\n<td>4</td>\n<td>5</td>\n</tr>\n<tr>\n<td>6</td>\n<td>7</td>\n<td>8</td>\n</tr>\n</tbody>\n</table>\n</div><ul>\n<li><strong>id</strong>: the id of the session, you will need this for all future requests for this session</li>\n<li><strong>next_turn</strong>: 'x' or 'o'; this identifies the player that will play next.</li>\n<li><strong>player_o</strong>: 'human', 'robot' or 'minimax';this identifies the type of player that assigned to play with letter 'o'</li>\n<li><strong>player_x</strong>: 'human', 'robot' or 'minimax; this identifies the type of player that assigned to play with letter 'x'</li>\n<li><strong>result</strong>: blank string, 'x', 'o', or 'draw'; this identifies the result of the game.</li>\n</ul>\n","urlObject":{"protocol":"http","path":["session"],"host":["alkindi","pythonanywhere","com"],"query":[],"variable":[]}},"response":[{"id":"7e35acd2-2ff9-4119-87da-4a7685a63f10","name":"Default","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"player_x\" : \"human\",\n    \"player_o\" : \"random\",\n    \"start\" : \"x\"\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"http://alkindi.pythonanywhere.com/session","protocol":"http","host":["alkindi","pythonanywhere","com"],"path":["session"],"query":[{"key":"pla","value":null,"type":"text","disabled":true}]}},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"game_board\": [\n        0,\n        1,\n        2,\n        3,\n        4,\n        5,\n        6,\n        7,\n        8\n    ],\n    \"id\": \"3788b48c-8cd7-4c02-802e-990ec64a9bc9\",\n    \"next_turn\": \"x\",\n    \"player_o\": \"random\",\n    \"player_x\": \"human\",\n    \"result\": \"\"\n}"}],"_postman_id":"646c54e5-c8ef-47ba-abcb-4859653fe882"},{"name":"http://alkindi.pythonanywhere.com/session","id":"d2e06c07-4cfa-43f5-a544-b881590af5a5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":"{\n    \"id\": \"048b37bc-38e7-4377-a37e-3cdc39d6ad4f\"\n}","options":{"raw":{"language":"json"}}},"url":"http://alkindi.pythonanywhere.com/session","description":"<p><strong>Get session details:</strong><br />This allows you to get your tic-tac-toe session details.</p>\n<p>the request body parameter are:</p>\n<ul>\n<li><strong>id</strong>: the id of the session that you want to get the details of.</li>\n</ul>\n<p>the response body :</p>\n<ul>\n<li><strong>game_board</strong>: a list of the cells in the sessions's tic-tac-toe board; [0,1,2,3,4,5,6,7,8], empty items will contain the index of the item, and occupied items will contain either 'x' or 'o'.</li>\n</ul>\n<p>Guide:</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>0</th>\n<th>1</th>\n<th>2</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>3</td>\n<td>4</td>\n<td>5</td>\n</tr>\n<tr>\n<td>6</td>\n<td>7</td>\n<td>8</td>\n</tr>\n</tbody>\n</table>\n</div><ul>\n<li><strong>id</strong>: the id of the session, you will need this for all future requests for this session</li>\n<li><strong>next_turn</strong>: 'x' or 'o'; this identifies the player that will play next.</li>\n<li><strong>player_o</strong>: 'human', 'robot' or 'minimax';this identifies the type of player that assigned to play with letter 'o'</li>\n<li><strong>player_x</strong>: 'human', 'robot' or 'minimax; this identifies the type of player that assigned to play with letter 'x'</li>\n<li><strong>result</strong>: blank string, 'x', 'o', or 'draw'; this identifies the result of the game.</li>\n</ul>\n","urlObject":{"protocol":"http","path":["session"],"host":["alkindi","pythonanywhere","com"],"query":[],"variable":[]}},"response":[{"id":"504b65d2-f831-4e0f-aea1-a49db0cac99c","name":"Default","originalRequest":{"method":"GET","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"id\": \"048b37bc-38e7-4377-a37e-3cdc39d6ad4f\"\n}","options":{"raw":{"language":"json"}}},"url":"http://alkindi.pythonanywhere.com/session"},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"board\": [\n        0,\n        1,\n        2,\n        3,\n        4,\n        5,\n        6,\n        7,\n        8\n    ],\n    \"id\": \"048b37bc-38e7-4377-a37e-3cdc39d6ad4f\",\n    \"next_turn\": \"x\",\n    \"player_o\": \"random\",\n    \"player_x\": \"human\",\n    \"result\": \"\"\n}"}],"_postman_id":"d2e06c07-4cfa-43f5-a544-b881590af5a5"},{"name":"http://alkindi.pythonanywhere.com/session/play","id":"34dbbef4-ae95-459b-bf6b-7a3fdda092fc","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":""},"url":"http://alkindi.pythonanywhere.com/session/play","description":"<p><strong>Play:</strong><br />This allows you to make a move.</p>\n<p>the request body parameter are:</p>\n<ul>\n<li><strong>id</strong>: the id of the session that you want to get the details of.</li>\n<li><strong>cell</strong>: the cell in which you want to play.</li>\n</ul>\n<p>the response body :</p>\n<ul>\n<li><strong>game_board</strong>: a list of the cells in the sessions's tic-tac-toe board; [0,1,2,3,4,5,6,7,8], empty items will contain the index of the item, and occupied items will contain either 'x' or 'o'.</li>\n</ul>\n<p>Guide:</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>0</th>\n<th>1</th>\n<th>2</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>3</td>\n<td>4</td>\n<td>5</td>\n</tr>\n<tr>\n<td>6</td>\n<td>7</td>\n<td>8</td>\n</tr>\n</tbody>\n</table>\n</div><ul>\n<li><strong>id</strong>: the id of the session, you will need this for all future requests for this session</li>\n<li><strong>next_turn</strong>: 'x' or 'o'; this identifies the player that will play next.</li>\n<li><strong>player_o</strong>: 'human', 'robot' or 'minimax';this identifies the type of player that assigned to play with letter 'o'</li>\n<li><strong>player_x</strong>: 'human', 'robot' or 'minimax; this identifies the type of player that assigned to play with letter 'x'</li>\n<li><strong>result</strong>: blank string, 'x', 'o', or 'draw'; this identifies the result of the game.</li>\n</ul>\n","urlObject":{"protocol":"http","path":["session","play"],"host":["alkindi","pythonanywhere","com"],"query":[],"variable":[]}},"response":[{"id":"96010c60-a69e-4bdb-98ae-66a7f41fadb1","name":"Default","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"id\":\"048b37bc-38e7-4377-a37e-3cdc39d6ad4f\",\n    \"cell\": 3\n}","options":{"raw":{"language":"json"}}},"url":"http://alkindi.pythonanywhere.com/session/play"},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"board\": [\n        0,\n        1,\n        \"o\",\n        \"x\",\n        4,\n        5,\n        6,\n        7,\n        8\n    ],\n    \"id\": \"048b37bc-38e7-4377-a37e-3cdc39d6ad4f\",\n    \"next_turn\": \"x\",\n    \"player_o\": \"random\",\n    \"player_x\": \"human\",\n    \"result\": \"\"\n}"}],"_postman_id":"34dbbef4-ae95-459b-bf6b-7a3fdda092fc"}]}