# Pick'em


## Get Players

<small class="badge badge-darkred">requires authentication</small>

Use this end point to get the contest entry players

> Example request:

```bash
curl -X GET \
    -G "https://apiqa.bettorfantasy.com/pickem/get-players" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"fantasy_spin_contest_entry_id":1,"fantasy_spin_blueprint_id":1,"game_id":11}'

```


> Example response (200):

```json
{
    "message": "Players",
    "data": {
        "players": [
            {
                "sportsdata_player_id": 40000387,
                "sportsdata_game_id": 642,
                "projection": 19.3,
                "headshot_high_resolution": "https:\/\/s3-us-west-2.amazonaws.com\/static.fantasydata.com\/usa-today\/headshots\/golf\/harris-english-40000387-08e10527.png",
                "short_name": "H. English"
            },
            {
                "sportsdata_player_id": 40000045,
                "sportsdata_game_id": 642,
                "projection": 14.5,
                "headshot_high_resolution": "https:\/\/s3-us-west-2.amazonaws.com\/static.fantasydata.com\/usa-today\/headshots\/golf\/byeong-hun-an-40000045-996a8adc.png",
                "short_name": "B. An"
            },
            {
                "sportsdata_player_id": 40005841,
                "sportsdata_game_id": 642,
                "projection": 13.6,
                "headshot_high_resolution": null,
                "short_name": "J. Hastings"
            },
            {
                "sportsdata_player_id": 40002913,
                "sportsdata_game_id": 642,
                "projection": 12.2,
                "headshot_high_resolution": "https:\/\/s3-us-west-2.amazonaws.com\/static.fantasydata.com\/usa-today\/headshots\/golf\/takumi-kanaya-40002913-075c3d52.png",
                "short_name": "T. Kanaya"
            },
            {
                "sportsdata_player_id": 40002343,
                "sportsdata_game_id": 642,
                "projection": 20.8,
                "headshot_high_resolution": "https:\/\/s3-us-west-2.amazonaws.com\/static.fantasydata.com\/usa-today\/headshots\/golf\/ben-griffin-40002343-6d034fe9.png",
                "short_name": "B. Griffin"
            },
            {
                "sportsdata_player_id": 40000430,
                "sportsdata_game_id": 642,
                "projection": 16.8,
                "headshot_high_resolution": "https:\/\/s3-us-west-2.amazonaws.com\/static.fantasydata.com\/usa-today\/headshots\/golf\/matthew-fitzpatrick-40000430-a647f966.png",
                "short_name": "M. Fitzpatrick"
            }
        ]
    }
}
```
<div id="execution-results-GETpickem-get-players" hidden>
    <blockquote>Received response<span id="execution-response-status-GETpickem-get-players"></span>:</blockquote>
    <pre class="json"><code id="execution-response-content-GETpickem-get-players"></code></pre>
</div>
<div id="execution-error-GETpickem-get-players" hidden>
    <blockquote>Request failed with error:</blockquote>
    <pre><code id="execution-error-message-GETpickem-get-players"></code></pre>
</div>
<form id="form-GETpickem-get-players" data-method="GET" data-path="pickem/get-players" data-authed="1" data-hasfiles="0" data-headers='{"Authorization":"Bearer {YOUR_AUTH_KEY}","Content-Type":"application\/json","Accept":"application\/json"}' onsubmit="event.preventDefault(); executeTryOut('GETpickem-get-players', this);">
<h3>
    Request&nbsp;&nbsp;&nbsp;
        <button type="button" style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-tryout-GETpickem-get-players" onclick="tryItOut('GETpickem-get-players');">Try it out ⚡</button>
    <button type="button" style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-canceltryout-GETpickem-get-players" onclick="cancelTryOut('GETpickem-get-players');" hidden>Cancel</button>&nbsp;&nbsp;
    <button type="submit" style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-executetryout-GETpickem-get-players" hidden>Send Request 💥</button>
    </h3>
<p>
<small class="badge badge-green">GET</small>
 <b><code>pickem/get-players</code></b>
</p>
<p>
<label id="auth-GETpickem-get-players" hidden>Authorization header: <b><code>Bearer </code></b><input type="text" name="Authorization" data-prefix="Bearer " data-endpoint="GETpickem-get-players" data-component="header"></label>
</p>
<h4 class="fancy-heading-panel"><b>Body Parameters</b></h4>
<p>
<b><code>fantasy_spin_contest_entry_id</code></b>&nbsp;&nbsp;<small>integer</small>  &nbsp;
<input type="number" name="fantasy_spin_contest_entry_id" data-endpoint="GETpickem-get-players" data-component="body" required  hidden>
<br>
Pick'em Contest Entry ID.
</p>
<p>
<b><code>fantasy_spin_blueprint_id</code></b>&nbsp;&nbsp;<small>integer</small>  &nbsp;
<input type="number" name="fantasy_spin_blueprint_id" data-endpoint="GETpickem-get-players" data-component="body" required  hidden>
<br>
Blueprint ID.
</p>
<p>
<b><code>game_id</code></b>&nbsp;&nbsp;<small>integer</small>  &nbsp;
<input type="number" name="game_id" data-endpoint="GETpickem-get-players" data-component="body" required  hidden>
<br>
Game ID: 1 (NFL), 2 (NBA), 3 (MLB), 4 (NHL).
</p>

</form>


## Confirm Pick&#039;em Entry

<small class="badge badge-darkred">requires authentication</small>

Use this endpoint to confirm a Pick'em contest entry for the authenticated user.

> Example request:

```bash
curl -X POST \
    "https://apiqa.bettorfantasy.com/pickem/confirm-entry" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"game_id":1,"buy_in":5,"payout":50,"multiplier":10,"picks":"\"Over,Under,Over\"","players":"aspernatur"}'

```


> Example response (200):

```json
{
    "message": "Pickem entry confirmed"
}
```
> Example response (422):

```json
{
    "message": "Validations",
    "error_box": {
        "message": "Request data missing",
        "cta": "Return",
        "color": "Blue",
        "cta_type": "Lobby"
    }
}
```
> Example response (422):

```json
{
    "message": "Validations",
    "error_box": {
        "heading": "Entry Fee Limit Exceeded",
        "message": "You cannot enter this contest because the entry fee exceeds the allowed maximum of $25.",
        "cta": "Return",
        "color": "Blue",
        "cta_type": "Lobby"
    }
}
```
<div id="execution-results-POSTpickem-confirm-entry" hidden>
    <blockquote>Received response<span id="execution-response-status-POSTpickem-confirm-entry"></span>:</blockquote>
    <pre class="json"><code id="execution-response-content-POSTpickem-confirm-entry"></code></pre>
</div>
<div id="execution-error-POSTpickem-confirm-entry" hidden>
    <blockquote>Request failed with error:</blockquote>
    <pre><code id="execution-error-message-POSTpickem-confirm-entry"></code></pre>
</div>
<form id="form-POSTpickem-confirm-entry" data-method="POST" data-path="pickem/confirm-entry" data-authed="1" data-hasfiles="0" data-headers='{"Authorization":"Bearer {YOUR_AUTH_KEY}","Content-Type":"application\/json","Accept":"application\/json"}' onsubmit="event.preventDefault(); executeTryOut('POSTpickem-confirm-entry', this);">
<h3>
    Request&nbsp;&nbsp;&nbsp;
        <button type="button" style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-tryout-POSTpickem-confirm-entry" onclick="tryItOut('POSTpickem-confirm-entry');">Try it out ⚡</button>
    <button type="button" style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-canceltryout-POSTpickem-confirm-entry" onclick="cancelTryOut('POSTpickem-confirm-entry');" hidden>Cancel</button>&nbsp;&nbsp;
    <button type="submit" style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-executetryout-POSTpickem-confirm-entry" hidden>Send Request 💥</button>
    </h3>
<p>
<small class="badge badge-black">POST</small>
 <b><code>pickem/confirm-entry</code></b>
</p>
<p>
<label id="auth-POSTpickem-confirm-entry" hidden>Authorization header: <b><code>Bearer </code></b><input type="text" name="Authorization" data-prefix="Bearer " data-endpoint="POSTpickem-confirm-entry" data-component="header"></label>
</p>
<h4 class="fancy-heading-panel"><b>Body Parameters</b></h4>
<p>
<b><code>game_id</code></b>&nbsp;&nbsp;<small>integer</small>  &nbsp;
<input type="number" name="game_id" data-endpoint="POSTpickem-confirm-entry" data-component="body" required  hidden>
<br>
The ID of the game. Allowed values: 1 to 7.
</p>
<p>
<b><code>buy_in</code></b>&nbsp;&nbsp;<small>number</small>  &nbsp;
<input type="number" name="buy_in" data-endpoint="POSTpickem-confirm-entry" data-component="body" required  hidden>
<br>
The entry fee for the contest. Must be 0 or more.
</p>
<p>
<b><code>payout</code></b>&nbsp;&nbsp;<small>number</small>  &nbsp;
<input type="number" name="payout" data-endpoint="POSTpickem-confirm-entry" data-component="body" required  hidden>
<br>
The payout amount for the contest. Must be 1 or more.
</p>
<p>
<b><code>multiplier</code></b>&nbsp;&nbsp;<small>number</small>  &nbsp;
<input type="number" name="multiplier" data-endpoint="POSTpickem-confirm-entry" data-component="body" required  hidden>
<br>
The payout multiplier.
</p>
<p>
<b><code>picks</code></b>&nbsp;&nbsp;<small>string</small>  &nbsp;
<input type="text" name="picks" data-endpoint="POSTpickem-confirm-entry" data-component="body" required  hidden>
<br>
The selected picks for the contest.
</p>
<p>
<details>
<summary>
<b><code>players</code></b>&nbsp;&nbsp;<small>array</small>  &nbsp;
<br>
List of player objects with individual pick data.
</summary>
<br>
<p>
<b><code>players[].sportsdata_player_id</code></b>&nbsp;&nbsp;<small>integer</small>  &nbsp;
<input type="number" name="players.0.sportsdata_player_id" data-endpoint="POSTpickem-confirm-entry" data-component="body" required  hidden>
<br>
The ID of the sports data player.
</p>
<p>
<b><code>players[].sportsdata_game_id</code></b>&nbsp;&nbsp;<small>integer</small>  &nbsp;
<input type="number" name="players.0.sportsdata_game_id" data-endpoint="POSTpickem-confirm-entry" data-component="body" required  hidden>
<br>
The ID of the game the player is participating in.
</p>
<p>
<b><code>players[].projection</code></b>&nbsp;&nbsp;<small>number</small>  &nbsp;
<input type="number" name="players.0.projection" data-endpoint="POSTpickem-confirm-entry" data-component="body" required  hidden>
<br>
The projection value for the player.
</p>
</details>
</p>

</form>


## Show Entry Details

<small class="badge badge-darkred">requires authentication</small>

Use this end point to show pick'em entry details

> Example request:

```bash
curl -X GET \
    -G "https://apiqa.bettorfantasy.com/pickem/show-entry/1" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
```


> Example response (200):

```json
{
    "message": "Pick'em Contest Entry Details!",
    "data": {
        "pickem_contest_entry": {
            "pickem_contest_entry_id": 2,
            "game_id": 1,
            "contest_name": "🏈 NFL Pick ‘Em Entry",
            "buy_in": "2.00",
            "payout": "10.00",
            "multiplier": 5,
            "picks": 3,
            "is_settled": 0
        },
        "pickem_contest_entry_players": [
            {
                "pickem_contest_entry_player_id": 7,
                "sportsdata_player_id": 9038,
                "projection": 14.4,
                "is_game_started": 0,
                "is_game_completed": 0,
                "is_played": 0,
                "result": null,
                "headshot_high_resolution": "http:\/\/127.0.0.1:8000\/images\/players\/nfl\/9038.png",
                "short_name": "M. Stafford",
                "schedule_time_utc": "08:25 PM",
                "game_info": "LAR vs HOU",
                "game_status": "---"
            },
            {
                "pickem_contest_entry_player_id": 8,
                "sportsdata_player_id": 17975,
                "projection": 7.9,
                "is_game_started": 0,
                "is_game_completed": 0,
                "is_played": 0,
                "result": null,
                "headshot_high_resolution": "http:\/\/127.0.0.1:8000\/images\/players\/nfl\/17975.png",
                "short_name": "H. Henry",
                "schedule_time_utc": "05:00 PM",
                "game_info": "NE vs LV",
                "game_status": "---"
            },
            {
                "pickem_contest_entry_player_id": 9,
                "sportsdata_player_id": 19562,
                "projection": 8.3,
                "is_game_started": 0,
                "is_game_completed": 0,
                "is_played": 0,
                "result": null,
                "headshot_high_resolution": "http:\/\/127.0.0.1:8000\/images\/players\/nfl\/19562.png",
                "short_name": "A. Ekeler",
                "schedule_time_utc": "05:00 PM",
                "game_info": "WAS vs NYG",
                "game_status": "---"
            }
        ]
    }
}
```
<div id="execution-results-GETpickem-show-entry--pickem_contest_entry_id-" hidden>
    <blockquote>Received response<span id="execution-response-status-GETpickem-show-entry--pickem_contest_entry_id-"></span>:</blockquote>
    <pre class="json"><code id="execution-response-content-GETpickem-show-entry--pickem_contest_entry_id-"></code></pre>
</div>
<div id="execution-error-GETpickem-show-entry--pickem_contest_entry_id-" hidden>
    <blockquote>Request failed with error:</blockquote>
    <pre><code id="execution-error-message-GETpickem-show-entry--pickem_contest_entry_id-"></code></pre>
</div>
<form id="form-GETpickem-show-entry--pickem_contest_entry_id-" data-method="GET" data-path="pickem/show-entry/{pickem_contest_entry_id}" data-authed="1" data-hasfiles="0" data-headers='{"Authorization":"Bearer {YOUR_AUTH_KEY}","Content-Type":"application\/json","Accept":"application\/json"}' onsubmit="event.preventDefault(); executeTryOut('GETpickem-show-entry--pickem_contest_entry_id-', this);">
<h3>
    Request&nbsp;&nbsp;&nbsp;
        <button type="button" style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-tryout-GETpickem-show-entry--pickem_contest_entry_id-" onclick="tryItOut('GETpickem-show-entry--pickem_contest_entry_id-');">Try it out ⚡</button>
    <button type="button" style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-canceltryout-GETpickem-show-entry--pickem_contest_entry_id-" onclick="cancelTryOut('GETpickem-show-entry--pickem_contest_entry_id-');" hidden>Cancel</button>&nbsp;&nbsp;
    <button type="submit" style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-executetryout-GETpickem-show-entry--pickem_contest_entry_id-" hidden>Send Request 💥</button>
    </h3>
<p>
<small class="badge badge-green">GET</small>
 <b><code>pickem/show-entry/{pickem_contest_entry_id}</code></b>
</p>
<p>
<label id="auth-GETpickem-show-entry--pickem_contest_entry_id-" hidden>Authorization header: <b><code>Bearer </code></b><input type="text" name="Authorization" data-prefix="Bearer " data-endpoint="GETpickem-show-entry--pickem_contest_entry_id-" data-component="header"></label>
</p>
<h4 class="fancy-heading-panel"><b>URL Parameters</b></h4>
<p>
<b><code>pickem_contest_entry_id</code></b>&nbsp;&nbsp;<small>integer</small>  &nbsp;
<input type="number" name="pickem_contest_entry_id" data-endpoint="GETpickem-show-entry--pickem_contest_entry_id-" data-component="url" required  hidden>
<br>
Pick'em Contest Entry ID.
</p>
</form>



