Example Flow 1: Participating in a custom draft room and changing your team name
Scenario: Alex, a veteran fantasy football player, is gearing up for the annual "Gridiron Glory" private league. He wants to do a mock draft with his other private league members. Alex decides to create a high-stakes PPR draft room designed for the other experienced players in his league. Once Alex has created and joined the draft room, one of Alex’s friends, Cameron, joins Alex’s draft. After joining the draft room and seeing Alex’s team name, Cameron decides that he wants to change his name into something more unique and fun.
1. Input
curl -X 'POST' \
'https://mockmaster.onrender.com/drafts/' \
-H 'accept: application/json' \
-H 'access_token: MockMaster' \
-H 'Content-Type: application/json' \
-d '{
"draft_type": "PPR",
"draft_name": "Alex'\''s draft",
"draft_size": 10,
"draft_length": 60,
"roster_positions": [
{
"position": "QB",
"min_num": 1,
"max_num": 2
},
{
"position": "RB",
"min_num": 3,
"max_num": 4
},
{
"position": "WR",
"min_num": 5,
"max_num": 6
},
{
"position": "TE",
"min_num": 7,
"max_num": 8
},
{
"position": "D/ST",
"min_num": 9,
"max_num": 10
},
{
"position": "K",
"min_num": 11,
"max_num": 12
}
],
"flex_spots": 0,
"roster_size": 12,
"team_name": "Alex'\''s Avengers",
"user_name": "Alex123"
}'
1. Output
2.
Cameron calls GET /drafts to retrieve a list of all available drafts to join. This list includes Alex’s league, which has a draft id of 22.
2. Input
curl -X 'GET' \
'https://mockmaster.onrender.com/drafts/' \
-H 'accept: application/json' \
-H 'access_token: MockMaster'
2. Output
[
{
"draft_id": 15,
"draft_name": "Fantastic Footies",
"draft_type": "LOL",
"draft_size": 1200,
"roster_size": 100,
"draft_length": 11,
"flex_spots": 60
},
{
"draft_id": 17,
"draft_name": "string",
"draft_type": "string",
"draft_size": 0,
"roster_size": 0,
"draft_length": 0,
"flex_spots": 0
},
{
"draft_id": 18,
"draft_name": "string",
"draft_type": "string",
"draft_size": 0,
"roster_size": 0,
"draft_length": 0,
"flex_spots": 0
},
{
"draft_id": 20,
"draft_name": "string",
"draft_type": "string",
"draft_size": 0,
"roster_size": 0,
"draft_length": 0,
"flex_spots": 0
},
{
"draft_id": 21,
"draft_name": "123",
"draft_type": "string",
"draft_size": 10,
"roster_size": 0,
"draft_length": 0,
"flex_spots": 0
},
{
"draft_id": 22,
"draft_name": "Alex's draft",
"draft_type": "PPR",
"draft_size": 10,
"roster_size": 12,
"draft_length": 60,
"flex_spots": 0
}
]
3.
Cameron calls POST/drafts/22/join with a team name of “Cameron’s Team” to join the draft room that Alex created and returns a team id of .
3. Input
curl -X 'POST' \
'https://mockmaster.onrender.com/drafts/22/join' \
-H 'accept: application/json' \
-H 'access_token: MockMaster' \
-H 'Content-Type: application/json' \
-d '{
"team_name": "Cameron'\''s Team",
"user_name": "Cameron123"
}'
3. Output
4.
Cameron calls PUT teams/36/ with a team name of “Cameron’s Commanders” to update his team name.
4. Input
curl -X 'PUT' \
'https://mockmaster.onrender.com/teams/36/' \
-H 'accept: application/json' \
-H 'access_token: MockMaster' \
-H 'Content-Type: application/json' \
-d '{
"team_name": "Cameron'\''s Commanders"
}'
4. Output
Internal Server Error
Example Flow 2: Accessing Player Statistics During Draft
Scenario: Samantha, a fantasy football analyst and blogger known for her strategic insights, is participating in a live draft broadcast. To provide her followers with real-time advice, she accesses detailed statistics for a sleeper pick that could turn the tide of any fantasy league.
1.
Samantha calls GET /players/ to get a list of all players available in the draft. This includes a player named “Justin Fields” with a player id of 6752, who Samantha believes is a sleeper in the draft.
1. Input
There is no endpoint to get a list of all players in a draft
Example Flow 3: Starting, Pausing, Resuming, and Ending a Draft
Scenario: Tyler, a fantasy football guru, has created a draft room. Once 7 other teams join his draft, he starts the draft and every team is assigned their draft pick. However, Tyler realizes that he left his stove on as the draft is beginning, so he quickly pauses the draft. After turning the stove off, Tyler resumes the draft. Once every team has made their selections, the draft is ended.
1.
Tyler calls PUT /drafts/{draft_id}/start to start the draft that he created. This automatically assigns each team in the draft a random number from 1 to the number of teams in the draft (with no duplicates). This number represents that team’s draft pick.
1. Input
curl -X 'PUT' \
'https://mockmaster.onrender.com/drafts/22/start' \
-H 'accept: application/json' \
-H 'access_token: MockMaster'
1. Output
{
"success": true,
"message": "Draft started and draft positions assigned randomly"
}
2.
Tyler calls PUT /drafts/{draft_id}/pause to pause the draft. At the current moment, nobody can make a pick and the draft timer for the current pick is halted.
2. Input
curl -X 'PUT' \
'https://mockmaster.onrender.com/drafts/22/pause' \
-H 'accept: application/json' \
-H 'access_token: MockMaster'
2. Output
"OK"
3.
Tyler calls PUT /drafts/{draft_id}/resume once he has turned off the stove to resume the draft.
3. Input
curl -X 'PUT' \
'https://mockmaster.onrender.com/drafts/22/resume' \
-H 'accept: application/json' \
-H 'access_token: MockMaster'
3. Output
{
"success": true,
"message": "Draft resumed successfully"
}
4.
The draft concludes with a call to PUT /drafts/{draft_id}/end.
4. Input
curl -X 'PUT' \
'https://mockmaster.onrender.com/drafts/22/end' \
-H 'accept: application/json' \
-H 'access_token: MockMaster'
4. Output
Custom Work Flows
Unauthorized starting and ending of a draft
Michael makes a get request of all of the current drafts and joins one with his team. He then attempts to start and end the draft on his own even though he didn't create the draft.
1.
calls /drafts/ to get draft rooms
1. Input
curl -X 'GET' \
'https://mockmaster.onrender.com/drafts/' \
-H 'accept: application/json' \
-H 'access_token: MockMaster'
1. Output
[
{
"draft_id": 15,
"draft_name": "Fantastic Footies",
"draft_type": "LOL",
"draft_size": 1200,
"roster_size": 100,
"draft_length": 11,
"flex_spots": 60
},
{
"draft_id": 17,
"draft_name": "string",
"draft_type": "string",
"draft_size": 0,
"roster_size": 0,
"draft_length": 0,
"flex_spots": 0
},
{
"draft_id": 18,
"draft_name": "string",
"draft_type": "string",
"draft_size": 0,
"roster_size": 0,
"draft_length": 0,
"flex_spots": 0
},
{
"draft_id": 20,
"draft_name": "string",
"draft_type": "string",
"draft_size": 0,
"roster_size": 0,
"draft_length": 0,
"flex_spots": 0
},
{
"draft_id": 21,
"draft_name": "123",
"draft_type": "string",
"draft_size": 10,
"roster_size": 0,
"draft_length": 0,
"flex_spots": 0
}
]
2.
Michael attempts to join draft with id 21 with post request
2. Input
curl -X 'POST' \
'https://mockmaster.onrender.com/drafts/21/join' \
-H 'accept: application/json' \
-H 'access_token: MockMaster' \
-H 'Content-Type: application/json' \
-d '{
"team_name": "Michael'\''s monsters",
"user_name": "michael234"
}'
2. Output
3.
Michael attempts to start the draft with a put with id 21
3. Input
curl -X 'PUT' \
'https://mockmaster.onrender.com/drafts/21/start' \
-H 'accept: application/json' \
-H 'access_token: MockMaster'
3. Output
{
"success": true,
"message": "Draft started and draft positions assigned randomly"
}
4.
Michael attempts to end the draft with a put with id 21
4. Input
curl -X 'PUT' \
'https://mockmaster.onrender.com/drafts/21/end' \
-H 'accept: application/json' \
-H 'access_token: MockMaster'
4. Output
Michael should not have access to start and end a draft if he is not the creator
###Creating a draft with too big of a draft size and roster size
Jerry wants to create a draft but he is a beginner and accidentally makes the draft size and roster size way too big. Will it let him?
1.
Jerry uses the post /drafts/ endpoint to create a draft
1. Input
curl -X 'POST' \
'https://mockmaster.onrender.com/drafts/' \
-H 'accept: application/json' \
-H 'access_token: MockMaster' \
-H 'Content-Type: application/json' \
-d '{
"draft_type": "PPR",
"draft_name": "Jerry'\''s draft",
"draft_size": 100000,
"draft_length": 60,
"roster_positions": [
{
"position": "QB",
"min_num": 1,
"max_num": 2
},
{
"position": "RB",
"min_num": 3,
"max_num": 4
},
{
"position": "WR",
"min_num": 5,
"max_num": 6
},
{
"position": "TE",
"min_num": 7,
"max_num": 8
},
{
"position": "D/ST",
"min_num": 9,
"max_num": 10
},
{
"position": "K",
"min_num": 11,
"max_num": 12
}
],
"flex_spots": 0,
"roster_size": 10000,
"team_name": "jerry'\''s jumpers",
"user_name": "jerry68"
}'
1. Output
Successfully created a draft even though the parameters are too big
Changing someone else's team name
Johnny creates a draft and his friend Tom joins it but has an inappropriate name so the creator, Johnny uses Tom's team_id to try to change his name
1.
Johnny creates a draft
1. Input
curl -X 'POST' \
'https://mockmaster.onrender.com/drafts/' \
-H 'accept: application/json' \
-H 'access_token: MockMaster' \
-H 'Content-Type: application/json' \
-d '{
"draft_type": "PPR",
"draft_name": "Johnny'\''s draft",
"draft_size": 10,
"draft_length": 60,
"roster_positions": [
{
"position": "QB",
"min_num": 1,
"max_num": 2
},
{
"position": "RB",
"min_num": 3,
"max_num": 4
},
{
"position": "WR",
"min_num": 5,
"max_num": 6
},
{
"position": "TE",
"min_num": 7,
"max_num": 8
},
{
"position": "D/ST",
"min_num": 9,
"max_num": 10
},
{
"position": "K",
"min_num": 11,
"max_num": 12
}
],
"flex_spots": 0,
"roster_size": 12,
"team_name": "johnny'\''s jokesters",
"user_name": "john05"
}'
1. Output
2.
Tom joins the draft with a bad name
2. Input
curl -X 'POST' \
'https://mockmaster.onrender.com/drafts/24/join' \
-H 'accept: application/json' \
-H 'access_token: MockMaster' \
-H 'Content-Type: application/json' \
-d '{
"team_name": "Tiny tom",
"user_name": "tom123"
}'
2. Output
3.
Johnny tries to change Tom's name
3. Input
curl -X 'PUT' \
'https://mockmaster.onrender.com/teams/40/' \
-H 'accept: application/json' \
-H 'access_token: MockMaster' \
-H 'Content-Type: application/json' \
-d '{
"team_name": "Titanic Tom"
}'
3. Output
Internal Server Error
Johnny cannot change Tom's name but I imagine it doesn't have to do with access or authorization
Example Flow 1: Participating in a custom draft room and changing your team name
Scenario: Alex, a veteran fantasy football player, is gearing up for the annual "Gridiron Glory" private league. He wants to do a mock draft with his other private league members. Alex decides to create a high-stakes PPR draft room designed for the other experienced players in his league. Once Alex has created and joined the draft room, one of Alex’s friends, Cameron, joins Alex’s draft. After joining the draft room and seeing Alex’s team name, Cameron decides that he wants to change his name into something more unique and fun.
1. Input
1. Output
2.
Cameron calls GET /drafts to retrieve a list of all available drafts to join. This list includes Alex’s league, which has a draft id of 22.
2. Input
2. Output
3.
Cameron calls POST/drafts/22/join with a team name of “Cameron’s Team” to join the draft room that Alex created and returns a team id of .
3. Input
3. Output
4.
Cameron calls PUT teams/36/ with a team name of “Cameron’s Commanders” to update his team name.
4. Input
4. Output
Internal Server Error
Example Flow 2: Accessing Player Statistics During Draft
Scenario: Samantha, a fantasy football analyst and blogger known for her strategic insights, is participating in a live draft broadcast. To provide her followers with real-time advice, she accesses detailed statistics for a sleeper pick that could turn the tide of any fantasy league.
1.
Samantha calls GET /players/ to get a list of all players available in the draft. This includes a player named “Justin Fields” with a player id of 6752, who Samantha believes is a sleeper in the draft.
1. Input
There is no endpoint to get a list of all players in a draft
Example Flow 3: Starting, Pausing, Resuming, and Ending a Draft
Scenario: Tyler, a fantasy football guru, has created a draft room. Once 7 other teams join his draft, he starts the draft and every team is assigned their draft pick. However, Tyler realizes that he left his stove on as the draft is beginning, so he quickly pauses the draft. After turning the stove off, Tyler resumes the draft. Once every team has made their selections, the draft is ended.
1.
Tyler calls PUT /drafts/{draft_id}/start to start the draft that he created. This automatically assigns each team in the draft a random number from 1 to the number of teams in the draft (with no duplicates). This number represents that team’s draft pick.
1. Input
1. Output
2.
Tyler calls PUT /drafts/{draft_id}/pause to pause the draft. At the current moment, nobody can make a pick and the draft timer for the current pick is halted.
2. Input
2. Output
"OK"3.
Tyler calls PUT /drafts/{draft_id}/resume once he has turned off the stove to resume the draft.
3. Input
3. Output
4.
The draft concludes with a call to PUT /drafts/{draft_id}/end.
4. Input
4. Output
Custom Work Flows
Unauthorized starting and ending of a draft
Michael makes a get request of all of the current drafts and joins one with his team. He then attempts to start and end the draft on his own even though he didn't create the draft.
1.
calls /drafts/ to get draft rooms
1. Input
1. Output
2.
Michael attempts to join draft with id 21 with post request
2. Input
2. Output
3.
Michael attempts to start the draft with a put with id 21
3. Input
3. Output
4.
Michael attempts to end the draft with a put with id 21
4. Input
4. Output
Michael should not have access to start and end a draft if he is not the creator
###Creating a draft with too big of a draft size and roster size
Jerry wants to create a draft but he is a beginner and accidentally makes the draft size and roster size way too big. Will it let him?
1.
Jerry uses the post /drafts/ endpoint to create a draft
1. Input
1. Output
Successfully created a draft even though the parameters are too big
Changing someone else's team name
Johnny creates a draft and his friend Tom joins it but has an inappropriate name so the creator, Johnny uses Tom's team_id to try to change his name
1.
Johnny creates a draft
1. Input
1. Output
2.
Tom joins the draft with a bad name
2. Input
2. Output
3.
Johnny tries to change Tom's name
3. Input
3. Output
Internal Server ErrorJohnny cannot change Tom's name but I imagine it doesn't have to do with access or authorization