# Feedback


## List

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

Use this end point to get list of feedbacks

> Example request:

```bash
curl -X GET \
    -G "https://apiqa.bettorfantasy.com/feedbacks?per_page=8&search=ut&sort_field=delectus&sort_method=quis&page=3&user_id=2" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
```


> Example response (200):

```json
{
    "message": "Feedbacks List",
    "data": {
        "feedbacks": {
            "current_page": 1,
            "data": [
                {
                    "id": 2,
                    "user_id": 1,
                    "feedback": "Lorem ipsum is simply dummy text",
                    "created_at": "2021-07-14T13:15:17.000000Z",
                    "updated_at": "2021-07-14T13:15:17.000000Z",
                    "user": {
                        "id": 1,
                        "email": "taha@elegantmicroweb.com",
                        "username": "tahasethwala",
                        "phone": "9925738146"
                    }
                },
                {
                    "id": 1,
                    "user_id": 1,
                    "feedback": "Lorem ipsum is simply dummy text",
                    "created_at": "2021-07-14T13:10:57.000000Z",
                    "updated_at": "2021-07-14T13:10:57.000000Z",
                    "user": {
                        "id": 1,
                        "email": "taha@elegantmicroweb.com",
                        "username": "tahasethwala",
                        "phone": "9925738146"
                    }
                }
            ],
            "first_page_url": "http:\/\/127.0.0.1:8000\/feedbacks?per_page=2&search=&sort_field=id&sort_method=desc&page=1",
            "from": 1,
            "last_page": 1,
            "last_page_url": "http:\/\/127.0.0.1:8000\/feedbacks?per_page=2&search=&sort_field=id&sort_method=desc&page=1",
            "links": [
                {
                    "url": null,
                    "label": "pagination.previous",
                    "active": false
                },
                {
                    "url": "http:\/\/127.0.0.1:8000\/feedbacks?per_page=2&search=&sort_field=id&sort_method=desc&page=1",
                    "label": "1",
                    "active": true
                },
                {
                    "url": null,
                    "label": "pagination.next",
                    "active": false
                }
            ],
            "next_page_url": null,
            "path": "http:\/\/127.0.0.1:8000\/feedbacks",
            "per_page": 2,
            "prev_page_url": null,
            "to": 2,
            "total": 2
        }
    }
}
```
> Example response (422):

```json
{
    "message": "Please enter required information",
    "errors": {
        "sort_field": [
            "The selected sort field is invalid."
        ]
    }
}
```
> Example response (403):

```json
{
    "message": "Access Forbidden"
}
```
<div id="execution-results-GETfeedbacks" hidden>
    <blockquote>Received response<span id="execution-response-status-GETfeedbacks"></span>:</blockquote>
    <pre class="json"><code id="execution-response-content-GETfeedbacks"></code></pre>
</div>
<div id="execution-error-GETfeedbacks" hidden>
    <blockquote>Request failed with error:</blockquote>
    <pre><code id="execution-error-message-GETfeedbacks"></code></pre>
</div>
<form id="form-GETfeedbacks" data-method="GET" data-path="feedbacks" data-authed="1" data-hasfiles="0" data-headers='{"Authorization":"Bearer {YOUR_AUTH_KEY}","Content-Type":"application\/json","Accept":"application\/json"}' onsubmit="event.preventDefault(); executeTryOut('GETfeedbacks', 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-GETfeedbacks" onclick="tryItOut('GETfeedbacks');">Try it out ⚡</button>
    <button type="button" style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-canceltryout-GETfeedbacks" onclick="cancelTryOut('GETfeedbacks');" hidden>Cancel</button>&nbsp;&nbsp;
    <button type="submit" style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-executetryout-GETfeedbacks" hidden>Send Request 💥</button>
    </h3>
<p>
<small class="badge badge-green">GET</small>
 <b><code>feedbacks</code></b>
</p>
<p>
<label id="auth-GETfeedbacks" hidden>Authorization header: <b><code>Bearer </code></b><input type="text" name="Authorization" data-prefix="Bearer " data-endpoint="GETfeedbacks" data-component="header"></label>
</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="GETfeedbacks" 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="GETfeedbacks" data-component="query"  hidden>
<br>
Search string. Search will be performed in feedback, user: email, user:username, user:phone. Ex: Fantasy
</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="GETfeedbacks" data-component="query"  hidden>
<br>
Sort by field. Possible values: id, user_id, feedback, created_at, season, week. Ex: user_id
</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="GETfeedbacks" 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="GETfeedbacks" data-component="query"  hidden>
<br>
Page number. Ex: 2
</p>
<p>
<b><code>user_id</code></b>&nbsp;&nbsp;<small>integer</small>     <i>optional</i> &nbsp;
<input type="number" name="user_id" data-endpoint="GETfeedbacks" data-component="query"  hidden>
<br>
User ID. Ex: 2
</p>
</form>


## Store

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

Use this end point to store feedback

> Example request:

```bash
curl -X POST \
    "https://apiqa.bettorfantasy.com/feedbacks/store" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"feedback":"illo"}'

```


> Example response (201):

```json
{
    "message": "Feedback Stored",
    "data": {
        "reward_earned_flag": 1
    }
}
```
> Example response (422):

```json
{
    "message": "Please enter required information",
    "errors": {
        "feedback": [
            "The feedback field is required."
        ]
    }
}
```
<div id="execution-results-POSTfeedbacks-store" hidden>
    <blockquote>Received response<span id="execution-response-status-POSTfeedbacks-store"></span>:</blockquote>
    <pre class="json"><code id="execution-response-content-POSTfeedbacks-store"></code></pre>
</div>
<div id="execution-error-POSTfeedbacks-store" hidden>
    <blockquote>Request failed with error:</blockquote>
    <pre><code id="execution-error-message-POSTfeedbacks-store"></code></pre>
</div>
<form id="form-POSTfeedbacks-store" data-method="POST" data-path="feedbacks/store" data-authed="1" data-hasfiles="0" data-headers='{"Authorization":"Bearer {YOUR_AUTH_KEY}","Content-Type":"application\/json","Accept":"application\/json"}' onsubmit="event.preventDefault(); executeTryOut('POSTfeedbacks-store', 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-POSTfeedbacks-store" onclick="tryItOut('POSTfeedbacks-store');">Try it out ⚡</button>
    <button type="button" style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-canceltryout-POSTfeedbacks-store" onclick="cancelTryOut('POSTfeedbacks-store');" hidden>Cancel</button>&nbsp;&nbsp;
    <button type="submit" style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-executetryout-POSTfeedbacks-store" hidden>Send Request 💥</button>
    </h3>
<p>
<small class="badge badge-black">POST</small>
 <b><code>feedbacks/store</code></b>
</p>
<p>
<label id="auth-POSTfeedbacks-store" hidden>Authorization header: <b><code>Bearer </code></b><input type="text" name="Authorization" data-prefix="Bearer " data-endpoint="POSTfeedbacks-store" data-component="header"></label>
</p>
<h4 class="fancy-heading-panel"><b>Body Parameters</b></h4>
<p>
<b><code>feedback</code></b>&nbsp;&nbsp;<small>string</small>  &nbsp;
<input type="text" name="feedback" data-endpoint="POSTfeedbacks-store" data-component="body" required  hidden>
<br>
Feedback given by the user. Ex: Lorem ipsum is simply dummy text
</p>

</form>


## My Feedbacks

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

Use this end point to store get my feedbacks

> Example request:

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


> Example response (200):

```json
{
    "message": "My Feedbacks",
    "data": {
        "feedbacks": [
            {
                "id": 1,
                "user_id": 1,
                "feedback": "Lorem ipsum is simply dummy text",
                "created_at": "2021-07-14T13:10:57.000000Z",
                "updated_at": "2021-07-14T13:10:57.000000Z"
            },
            {
                "id": 2,
                "user_id": 1,
                "feedback": "Lorem ipsum is simply dummy text",
                "created_at": "2021-07-14T13:15:17.000000Z",
                "updated_at": "2021-07-14T13:15:17.000000Z"
            }
        ]
    }
}
```
<div id="execution-results-GETfeedbacks-my-feedbacks" hidden>
    <blockquote>Received response<span id="execution-response-status-GETfeedbacks-my-feedbacks"></span>:</blockquote>
    <pre class="json"><code id="execution-response-content-GETfeedbacks-my-feedbacks"></code></pre>
</div>
<div id="execution-error-GETfeedbacks-my-feedbacks" hidden>
    <blockquote>Request failed with error:</blockquote>
    <pre><code id="execution-error-message-GETfeedbacks-my-feedbacks"></code></pre>
</div>
<form id="form-GETfeedbacks-my-feedbacks" data-method="GET" data-path="feedbacks/my-feedbacks" data-authed="1" data-hasfiles="0" data-headers='{"Authorization":"Bearer {YOUR_AUTH_KEY}","Content-Type":"application\/json","Accept":"application\/json"}' onsubmit="event.preventDefault(); executeTryOut('GETfeedbacks-my-feedbacks', 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-GETfeedbacks-my-feedbacks" onclick="tryItOut('GETfeedbacks-my-feedbacks');">Try it out ⚡</button>
    <button type="button" style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-canceltryout-GETfeedbacks-my-feedbacks" onclick="cancelTryOut('GETfeedbacks-my-feedbacks');" hidden>Cancel</button>&nbsp;&nbsp;
    <button type="submit" style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-executetryout-GETfeedbacks-my-feedbacks" hidden>Send Request 💥</button>
    </h3>
<p>
<small class="badge badge-green">GET</small>
 <b><code>feedbacks/my-feedbacks</code></b>
</p>
<p>
<label id="auth-GETfeedbacks-my-feedbacks" hidden>Authorization header: <b><code>Bearer </code></b><input type="text" name="Authorization" data-prefix="Bearer " data-endpoint="GETfeedbacks-my-feedbacks" data-component="header"></label>
</p>
</form>



