{"info":{"_postman_id":"81ff236f-f92f-4895-885f-79ba1482e93c","name":"CatPul","description":"<html><head></head><body><h1 id=\"introduction\">Introduction</h1>\n<p>This is the documentation of the REST API created for my personal project CatPul. The project link is: <a href=\"https://github.com/razashoaib/CatapultSportsEx\">https://github.com/razashoaib/CatapultSportsEx</a></p>\n<h1 id=\"authentication\">Authentication</h1>\n<p>What is the preferred way of using the API?</p>\n<p>All the endpoints expects a token in the header which is generated from User Login API. Only two endpoints are public User Login and Register User.</p>\n<h1 id=\"error-codes\">Error Codes</h1>\n<p>What errors and status codes can a user expect?</p>\n<p>200, 201, 500</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"Introduction","slug":"introduction"},{"content":"Authentication","slug":"authentication"},{"content":"Error Codes","slug":"error-codes"}],"owner":"4947249","collectionId":"81ff236f-f92f-4895-885f-79ba1482e93c","publishedId":"RWMLKmKt","public":true,"customColor":{"top-bar":"855723","right-sidebar":"303030","highlight":"003066"},"publishDate":"2018-07-29T15:11:05.000Z"},"item":[{"name":"Get All Athletes","id":"04cc6cc7-6d24-4c9d-98c1-e1bbe68781ef","request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer Token"}],"body":{"mode":"formdata","formdata":[]},"url":"http://localhost/api/athletes","description":"<p>Returns all the Athletes with their associated Teams and Sports.</p>\n","urlObject":{"protocol":"http","path":["api","athletes"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"04cc6cc7-6d24-4c9d-98c1-e1bbe68781ef"},{"name":"Get All Sports","id":"40b1bf50-f07f-4652-805c-af3c6144a7b5","request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer Token"}],"body":{"mode":"formdata","formdata":[]},"url":"http://localhost/api/sports","description":"<p>Returns all Sports with their respective Teams and Athletes.</p>\n","urlObject":{"protocol":"http","path":["api","sports"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"40b1bf50-f07f-4652-805c-af3c6144a7b5"},{"name":"Get All Teams","id":"1611c2cb-0f5e-47be-bfde-3115436566a7","request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer Token"}],"body":{"mode":"formdata","formdata":[]},"url":"http://localhost/api/teams","description":"<p>Returns all Teams with its associated Sport and Athletes.</p>\n","urlObject":{"protocol":"http","path":["api","teams"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"1611c2cb-0f5e-47be-bfde-3115436566a7"},{"name":"Add Athlete","id":"e2c312f2-edf6-49f9-a4aa-cea42c982001","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"Bearer Token"}],"body":{"mode":"raw","raw":"{\r\n\t\"athlete_name\": \"Christiano fRonafldo\",\r\n\t\"athlete_dob\" : \"27-04-1992\",\r\n    \"athlete_age\" : 26,\r\n    \"athlete_height\" : 6.5,\r\n    \"athlete_body_weight\" : 75\r\n}"},"url":"http://localhost/api/add_athlete","description":"<p>This service adds an Athlete.</p>\n","urlObject":{"protocol":"http","path":["api","add_athlete"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"e2c312f2-edf6-49f9-a4aa-cea42c982001"},{"name":"Add Sport","id":"c4865317-f6b9-414c-9fcd-6f6c5de96b39","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"Bearer Token"}],"body":{"mode":"raw","raw":"{\r\n\t\"sport_name\": \"Cricketss\"\r\n}"},"url":"http://localhost/api/add_sport","description":"<p>This service adds an Sport.</p>\n","urlObject":{"protocol":"http","path":["api","add_sport"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"c4865317-f6b9-414c-9fcd-6f6c5de96b39"},{"name":"Add Team With Sport","id":"3592e9aa-4ead-48de-b829-a3363bdd1e38","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"Bearer Token"}],"body":{"mode":"raw","raw":"{\r\n\t\"team_name\": \"Real Madrid\",\r\n\t\"team_logo\": \"http://www.fm-base.co.uk/forum/attachments/club-competition-logos/1114673-rocheybs-custom-logo-creation-thread-manchester-united_1_400px.png\",\r\n\t\"sport_id\": 1\r\n}"},"url":"http://localhost/api/add_team","description":"<p>This service adds an Team with its Sport.</p>\n","urlObject":{"protocol":"http","path":["api","add_team"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"3592e9aa-4ead-48de-b829-a3363bdd1e38"},{"name":"Add Teams For Athlete","id":"0c7d45e9-bd69-4556-9ae5-52f991c6f762","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"Bearer Token"}],"body":{"mode":"raw","raw":"{\n\t\"athlete_id\" : 8,\n\t\"team_id_array\" : []\n}"},"url":"http://localhost/api/add_athlete_teams","description":"<p>This service expects an array of Team ids and associate it with the given Athlete id.</p>\n","urlObject":{"protocol":"http","path":["api","add_athlete_teams"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"0c7d45e9-bd69-4556-9ae5-52f991c6f762"},{"name":"Add Sports For Athlete","id":"81f7ef26-f128-4dba-bf3f-3fb3ca3e8d1b","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"Bearer Token"}],"body":{"mode":"raw","raw":"{\n\t\"athlete_id\" : 2,\n\t\"sport_id_array\" : []\n}"},"url":"http://localhost/api/add_athlete_sports","description":"<p>This service expects an array of Sport ids and associate it with the given Athlete id.</p>\n","urlObject":{"protocol":"http","path":["api","add_athlete_sports"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"81f7ef26-f128-4dba-bf3f-3fb3ca3e8d1b"},{"name":"Update Athlete","id":"f9e4d4f6-5dd0-4dff-b56d-38216fa83ea1","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"Bearer Token"}],"body":{"mode":"raw","raw":"{\n\t\"athlete_name\": \"Syed Abidi\",\n\t\"athlete_dob\" : \"27-04-1992\",\n    \"athlete_age\" : 26,\n    \"athlete_height\" : 6.5,\n    \"athlete_body_weight\" : 75\n}"},"url":"http://localhost/api/update_athlete/1","description":"<p>This service will update the existing Athlete using the id provided in the url.</p>\n","urlObject":{"protocol":"http","path":["api","update_athlete","1"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"f9e4d4f6-5dd0-4dff-b56d-38216fa83ea1"},{"name":"Update Sport","id":"2306a3a8-ac74-4160-9370-d64935a5fc69","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"Bearer Token"}],"body":{"mode":"raw","raw":"{\n\t\"sport_name\" : \"Soccer\"\n}"},"url":"http://localhost/api/update_sport/2","description":"<p>This service will update the existing Sport using the id provided in the url.</p>\n","urlObject":{"protocol":"http","path":["api","update_sport","2"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"2306a3a8-ac74-4160-9370-d64935a5fc69"},{"name":"Update Team","id":"d39fceb1-5ba6-4b6b-8d14-b413d693d3b0","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"Bearer Token"}],"body":{"mode":"raw","raw":"{\n\t\"team_name\" : \"Soccer\",\n\t\"team_logo\" : \"Soccer\",\n\t\"sport_id\" : 2\n}"},"url":"http://localhost/api/update_team/5","description":"<p>This service will update the existing Team using the id provided in the url.</p>\n","urlObject":{"protocol":"http","path":["api","update_team","5"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"d39fceb1-5ba6-4b6b-8d14-b413d693d3b0"},{"name":"Delete Athlete","id":"0bd6daf5-3708-4ad6-85f6-ab3b38699d73","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"Bearer Token"}],"body":{"mode":"raw","raw":""},"url":"http://localhost/api/delete_athlete/1","description":"<p>Deletes an Athlete.</p>\n","urlObject":{"protocol":"http","path":["api","delete_athlete","1"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"0bd6daf5-3708-4ad6-85f6-ab3b38699d73"},{"name":"Delete Sport","id":"02a99867-9503-4f32-b42e-5074fd4c8044","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"Bearer Token"}],"body":{"mode":"raw","raw":""},"url":"http://localhost/api/delete_sport/2","description":"<p>Deletes a Sport.</p>\n","urlObject":{"protocol":"http","path":["api","delete_sport","2"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"02a99867-9503-4f32-b42e-5074fd4c8044"},{"name":"Delete Team","id":"dd7dda25-9f01-4234-a227-719390459fcf","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"Bearer Token"}],"body":{"mode":"raw","raw":""},"url":"http://localhost/api/delete_team/6","description":"<p>Deletes a Team.</p>\n","urlObject":{"protocol":"http","path":["api","delete_team","6"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"dd7dda25-9f01-4234-a227-719390459fcf"},{"name":"User Login","id":"3d80684e-1c24-4807-bde9-34bcfa107418","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"email\" : \"razashoaib91@gmail.com\",\n    \"password\" : \"shoaib\"\n}"},"url":"http://localhost/api/login","description":"<p>Authenticates a User and returns a token.</p>\n","urlObject":{"protocol":"http","path":["api","login"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"3d80684e-1c24-4807-bde9-34bcfa107418"},{"name":"Register User","id":"a49832c5-d70c-4a5c-8a4f-c699924560a6","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"name\" : \"Syed Abidi\",\n    \"email\" : \"razashoaib91@gmail.com\",\n    \"password\" : \"shoaib\",\n    \"c_password\" : \"shoaib\"\n}"},"url":"http://localhost/api/register","description":"<p>Register a user.</p>\n","urlObject":{"protocol":"http","path":["api","register"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"a49832c5-d70c-4a5c-8a4f-c699924560a6"}]}