# KYC


## List

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

Use this end point to get the list of user's KYC attempts

> Example request:

```bash
curl -X GET \
    -G "https://apiqa.bettorfantasy.com/kycs?per_page=2&search=et&sort_field=officia&sort_method=et&page=17&user_id=12" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
```


> Example response (200):

```json
{
    "message": "User KYC history",
    "data": {
        "kycs": {
            "current_page": 1,
            "data": [
                {
                    "id": 5,
                    "user_id": 1,
                    "first_name": "Taha",
                    "last_name": "Sethwala",
                    "dob": "1996-01-14",
                    "street_address": "A\/4, Unit Hills, Juhapura, Ahmedabad",
                    "zip": 32767,
                    "created_at": "2022-04-21T05:49:51.000000Z",
                    "updated_at": "2022-04-21T05:49:53.000000Z",
                    "response": {
                        "response": {
                            "error": [
                                "Your IP address is not registered. Please contact IDology Customer Service at 866-520-1234 or email customerservice@idology.com",
                                "No address submitted"
                            ]
                        }
                    },
                    "kyc_status_id": 1,
                    "kyc_status": {
                        "id": 1,
                        "name": "Not performed",
                        "created_at": "2022-04-21T05:28:34.000000Z",
                        "updated_at": "2022-04-21T05:28:34.000000Z"
                    }
                }
            ],
            "first_page_url": "http:\/\/localhost:8000\/kycs?per_page=1&search=&sort_field=id&sort_method=desc&user_id=1&page=1",
            "from": 1,
            "last_page": 5,
            "last_page_url": "http:\/\/localhost:8000\/kycs?per_page=1&search=&sort_field=id&sort_method=desc&user_id=1&page=5",
            "links": [
                {
                    "url": null,
                    "label": "pagination.previous",
                    "active": false
                },
                {
                    "url": "http:\/\/localhost:8000\/kycs?per_page=1&search=&sort_field=id&sort_method=desc&user_id=1&page=1",
                    "label": "1",
                    "active": true
                },
                {
                    "url": "http:\/\/localhost:8000\/kycs?per_page=1&search=&sort_field=id&sort_method=desc&user_id=1&page=2",
                    "label": "2",
                    "active": false
                },
                {
                    "url": "http:\/\/localhost:8000\/kycs?per_page=1&search=&sort_field=id&sort_method=desc&user_id=1&page=3",
                    "label": "3",
                    "active": false
                },
                {
                    "url": "http:\/\/localhost:8000\/kycs?per_page=1&search=&sort_field=id&sort_method=desc&user_id=1&page=4",
                    "label": "4",
                    "active": false
                },
                {
                    "url": "http:\/\/localhost:8000\/kycs?per_page=1&search=&sort_field=id&sort_method=desc&user_id=1&page=5",
                    "label": "5",
                    "active": false
                },
                {
                    "url": "http:\/\/localhost:8000\/kycs?per_page=1&search=&sort_field=id&sort_method=desc&user_id=1&page=2",
                    "label": "pagination.next",
                    "active": false
                }
            ],
            "next_page_url": "http:\/\/localhost:8000\/kycs?per_page=1&search=&sort_field=id&sort_method=desc&user_id=1&page=2",
            "path": "http:\/\/localhost:8000\/kycs",
            "per_page": "1",
            "prev_page_url": null,
            "to": 1,
            "total": 5
        }
    }
}
```
> Example response (422):

```json
{
    "message": "Validation Failed!",
    "errors": {
        "per_page": [
            "The per page must be a number."
        ]
    }
}
```
<div id="execution-results-GETkycs" hidden>
    <blockquote>Received response<span id="execution-response-status-GETkycs"></span>:</blockquote>
    <pre class="json"><code id="execution-response-content-GETkycs"></code></pre>
</div>
<div id="execution-error-GETkycs" hidden>
    <blockquote>Request failed with error:</blockquote>
    <pre><code id="execution-error-message-GETkycs"></code></pre>
</div>
<form id="form-GETkycs" data-method="GET" data-path="kycs" data-authed="1" data-hasfiles="0" data-headers='{"Authorization":"Bearer {YOUR_AUTH_KEY}","Content-Type":"application\/json","Accept":"application\/json"}' onsubmit="event.preventDefault(); executeTryOut('GETkycs', 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-GETkycs" onclick="tryItOut('GETkycs');">Try it out ⚡</button>
    <button type="button" style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-canceltryout-GETkycs" onclick="cancelTryOut('GETkycs');" hidden>Cancel</button>&nbsp;&nbsp;
    <button type="submit" style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-executetryout-GETkycs" hidden>Send Request 💥</button>
    </h3>
<p>
<small class="badge badge-green">GET</small>
 <b><code>kycs</code></b>
</p>
<p>
<label id="auth-GETkycs" hidden>Authorization header: <b><code>Bearer </code></b><input type="text" name="Authorization" data-prefix="Bearer " data-endpoint="GETkycs" 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="GETkycs" 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="GETkycs" data-component="query"  hidden>
<br>
Search string. Search will be performed in first_name, last_name, street_address, zip. Ex: Unit
</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="GETkycs" data-component="query"  hidden>
<br>
Sort by field. Possible values: id, kyc_status_id, first_name, last_name, dob, street_address, zip, created_at. Ex: first_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="GETkycs" 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="GETkycs" data-component="query"  hidden>
<br>
Page number. Ex: 2
</p>
<p>
<b><code>user_id</code></b>&nbsp;&nbsp;<small>integer</small>  &nbsp;
<input type="number" name="user_id" data-endpoint="GETkycs" data-component="query" required  hidden>
<br>
User ID. Ex: 1
</p>
</form>



