# Master


## States


Use this end point to get the list of all states

> Example request:

```bash
curl -X GET \
    -G "https://apiqa.bettorfantasy.com/states?per_page=19&search=aut&sort_field=ex&sort_method=magnam&page=15" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
```


> Example response (200):

```json
{
    "message": "States list",
    "data": {
        "states": {
            "current_page": 1,
            "data": [
                {
                    "id": 1,
                    "code": "AK",
                    "name": "Alaska"
                },
                {
                    "id": 3,
                    "code": "AZ",
                    "name": "Arizona"
                },
                {
                    "id": 4,
                    "code": "AR",
                    "name": "Arkansas"
                },
                {
                    "id": 5,
                    "code": "CA",
                    "name": "California"
                },
                {
                    "id": 6,
                    "code": "CO",
                    "name": "Colorado"
                }
            ],
            "first_page_url": "http:\/\/localhost:8001\/states?per_page=5&search=&sort_field=id&sort_method=asc&page=1",
            "from": 1,
            "last_page": 11,
            "last_page_url": "http:\/\/localhost:8001\/states?per_page=5&search=&sort_field=id&sort_method=asc&page=11",
            "links": [
                {
                    "url": null,
                    "label": "pagination.previous",
                    "active": false
                },
                {
                    "url": "http:\/\/localhost:8001\/states?per_page=5&search=&sort_field=id&sort_method=asc&page=1",
                    "label": "1",
                    "active": true
                },
                {
                    "url": "http:\/\/localhost:8001\/states?per_page=5&search=&sort_field=id&sort_method=asc&page=2",
                    "label": "2",
                    "active": false
                },
                {
                    "url": "http:\/\/localhost:8001\/states?per_page=5&search=&sort_field=id&sort_method=asc&page=2",
                    "label": "pagination.next",
                    "active": false
                }
            ],
            "next_page_url": "http:\/\/localhost:8001\/states?per_page=5&search=&sort_field=id&sort_method=asc&page=2",
            "path": "http:\/\/localhost:8001\/states",
            "per_page": "5",
            "prev_page_url": null,
            "to": 5,
            "total": 52
        }
    }
}
```
<div id="execution-results-GETstates" hidden>
    <blockquote>Received response<span id="execution-response-status-GETstates"></span>:</blockquote>
    <pre class="json"><code id="execution-response-content-GETstates"></code></pre>
</div>
<div id="execution-error-GETstates" hidden>
    <blockquote>Request failed with error:</blockquote>
    <pre><code id="execution-error-message-GETstates"></code></pre>
</div>
<form id="form-GETstates" data-method="GET" data-path="states" data-authed="0" data-hasfiles="0" data-headers='{"Content-Type":"application\/json","Accept":"application\/json"}' onsubmit="event.preventDefault(); executeTryOut('GETstates', 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" onclick="tryItOut('GETstates');">Try it out ⚡</button>
    <button type="button" style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-canceltryout-GETstates" onclick="cancelTryOut('GETstates');" 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" hidden>Send Request 💥</button>
    </h3>
<p>
<small class="badge badge-green">GET</small>
 <b><code>states</code></b>
</p>
<h4 class="fancy-heading-panel"><b>Query Parameters</b></h4>
<p>
<b><code>per_page</code></b>&nbsp;&nbsp;<small>integer</small>     <i>optional</i> &nbsp;
<input type="number" name="per_page" data-endpoint="GETstates" data-component="query"  hidden>
<br>
Number of records per page. Send '-1' for all records. Default: 10. Ex: 15
</p>
<p>
<b><code>search</code></b>&nbsp;&nbsp;<small>string</small>     <i>optional</i> &nbsp;
<input type="text" name="search" data-endpoint="GETstates" data-component="query"  hidden>
<br>
Search string. Ex: Alaska
</p>
<p>
<b><code>sort_field</code></b>&nbsp;&nbsp;<small>string</small>     <i>optional</i> &nbsp;
<input type="text" name="sort_field" data-endpoint="GETstates" data-component="query"  hidden>
<br>
Sort by field. Possible values: id, code, name. Ex: name
</p>
<p>
<b><code>sort_method</code></b>&nbsp;&nbsp;<small>string</small>     <i>optional</i> &nbsp;
<input type="text" name="sort_method" data-endpoint="GETstates" data-component="query"  hidden>
<br>
Sort by method. Possible values: asc, desc. Ex: desc
</p>
<p>
<b><code>page</code></b>&nbsp;&nbsp;<small>integer</small>     <i>optional</i> &nbsp;
<input type="number" name="page" data-endpoint="GETstates" data-component="query"  hidden>
<br>
Page number. Works if paginate is set to 1. Ex: 2
</p>
</form>



