# State


## List

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

Use this end point to get the list of states

> Example request:

```bash
curl -X GET \
    -G "https://apiqa.bettorfantasy.com/states/list?search=voluptas" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
```


> Example response (200):

```json
{
    "message": "State list",
    "data": {
        "states": {
            "current_page": 1,
            "data": [
                {
                    "id": 54,
                    "code": "AL",
                    "name": "Alabama",
                    "min_age_required": 18,
                    "is_ncaa_cash_contest_allowed": 0,
                    "is_cash_eligible": 0,
                    "is_pickem_cash_eligible": 0,
                    "daily_limit": "500.00",
                    "weekly_limit": "1000.00",
                    "monthly_limit": "3000.00"
                }
            ],
            "first_page_url": "http:\/\/127.0.0.1:8000\/states\/list?page=1",
            "from": 1,
            "last_page": 6,
            "last_page_url": "http:\/\/127.0.0.1:8000\/states\/list?page=6",
            "links": [
                {
                    "url": null,
                    "label": "pagination.previous",
                    "active": false
                },
                {
                    "url": "http:\/\/127.0.0.1:8000\/states\/list?page=1",
                    "label": "1",
                    "active": true
                },
                {
                    "url": "http:\/\/127.0.0.1:8000\/states\/list?page=2",
                    "label": "2",
                    "active": false
                },
                {
                    "url": "http:\/\/127.0.0.1:8000\/states\/list?page=3",
                    "label": "3",
                    "active": false
                },
                {
                    "url": "http:\/\/127.0.0.1:8000\/states\/list?page=4",
                    "label": "4",
                    "active": false
                },
                {
                    "url": "http:\/\/127.0.0.1:8000\/states\/list?page=5",
                    "label": "5",
                    "active": false
                },
                {
                    "url": "http:\/\/127.0.0.1:8000\/states\/list?page=6",
                    "label": "6",
                    "active": false
                },
                {
                    "url": "http:\/\/127.0.0.1:8000\/states\/list?page=2",
                    "label": "pagination.next",
                    "active": false
                }
            ],
            "next_page_url": "http:\/\/127.0.0.1:8000\/states\/list?page=2",
            "path": "http:\/\/127.0.0.1:8000\/states\/list",
            "per_page": 10,
            "prev_page_url": null,
            "to": 10,
            "total": 53
        }
    }
}
```
<div id="execution-results-GETstates-list" hidden>
    <blockquote>Received response<span id="execution-response-status-GETstates-list"></span>:</blockquote>
    <pre class="json"><code id="execution-response-content-GETstates-list"></code></pre>
</div>
<div id="execution-error-GETstates-list" hidden>
    <blockquote>Request failed with error:</blockquote>
    <pre><code id="execution-error-message-GETstates-list"></code></pre>
</div>
<form id="form-GETstates-list" data-method="GET" data-path="states/list" data-authed="1" data-hasfiles="0" data-headers='{"Authorization":"Bearer {YOUR_AUTH_KEY}","Content-Type":"application\/json","Accept":"application\/json"}' onsubmit="event.preventDefault(); executeTryOut('GETstates-list', 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-GETstates-list" onclick="tryItOut('GETstates-list');">Try it out ⚡</button>
    <button type="button" style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-canceltryout-GETstates-list" onclick="cancelTryOut('GETstates-list');" hidden>Cancel</button>&nbsp;&nbsp;
    <button type="submit" style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-executetryout-GETstates-list" hidden>Send Request 💥</button>
    </h3>
<p>
<small class="badge badge-green">GET</small>
 <b><code>states/list</code></b>
</p>
<p>
<label id="auth-GETstates-list" hidden>Authorization header: <b><code>Bearer </code></b><input type="text" name="Authorization" data-prefix="Bearer " data-endpoint="GETstates-list" data-component="header"></label>
</p>
<h4 class="fancy-heading-panel"><b>Query Parameters</b></h4>
<p>
<b><code>search</code></b>&nbsp;&nbsp;<small>string</small>     <i>optional</i> &nbsp;
<input type="text" name="search" data-endpoint="GETstates-list" data-component="query"  hidden>
<br>
Search string. Search will be performed in name or code.
</p>
</form>


## View

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

Use this end point to view a state details

> Example request:

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


> Example response (200):

```json
{
    "message": "State details",
    "data": {
        "state": {
            "id": 1,
            "code": "AK",
            "name": "Alaska",
            "min_age_required": 18,
            "is_ncaa_cash_contest_allowed": 1,
            "is_cash_eligible": 1,
            "is_pickem_cash_eligible": 1,
            "daily_limit": "500.00",
            "weekly_limit": "1000.00",
            "monthly_limit": "3000.00"
        }
    }
}
```
> Example response (404):

```json
{
    "message": "state not found!"
}
```
<div id="execution-results-GETstate-data--id-" hidden>
    <blockquote>Received response<span id="execution-response-status-GETstate-data--id-"></span>:</blockquote>
    <pre class="json"><code id="execution-response-content-GETstate-data--id-"></code></pre>
</div>
<div id="execution-error-GETstate-data--id-" hidden>
    <blockquote>Request failed with error:</blockquote>
    <pre><code id="execution-error-message-GETstate-data--id-"></code></pre>
</div>
<form id="form-GETstate-data--id-" data-method="GET" data-path="state/data/{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('GETstate-data--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-GETstate-data--id-" onclick="tryItOut('GETstate-data--id-');">Try it out ⚡</button>
    <button type="button" style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-canceltryout-GETstate-data--id-" onclick="cancelTryOut('GETstate-data--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-GETstate-data--id-" hidden>Send Request 💥</button>
    </h3>
<p>
<small class="badge badge-green">GET</small>
 <b><code>state/data/{id}</code></b>
</p>
<p>
<label id="auth-GETstate-data--id-" hidden>Authorization header: <b><code>Bearer </code></b><input type="text" name="Authorization" data-prefix="Bearer " data-endpoint="GETstate-data--id-" data-component="header"></label>
</p>
<h4 class="fancy-heading-panel"><b>URL Parameters</b></h4>
<p>
<b><code>id</code></b>&nbsp;&nbsp;<small>integer</small>  &nbsp;
<input type="number" name="id" data-endpoint="GETstate-data--id-" data-component="url" required  hidden>
<br>
state Id.
</p>
</form>



