# Admin-Auth


## Admin Sign In


Use this end point to sign in for admin portal

> Example request:

```bash
curl -X POST \
    "https://apiqa.bettorfantasy.com/admin/sign-in" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"email":"quibusdam","password":"commodi"}'

```


> Example response (200):

```json
{
    "message": "Credentials are correct, please provide OTP sent to your mobile.",
    "data": {
        "email": "admin@bettorfantasy.com"
    }
}
```
> Example response (422):

```json
{
    "message": "Please enter required information",
    "errors": {
        "email": [
            "The email field is required."
        ],
        "password": [
            "The password field is required."
        ]
    }
}
```
<div id="execution-results-POSTadmin-sign-in" hidden>
    <blockquote>Received response<span id="execution-response-status-POSTadmin-sign-in"></span>:</blockquote>
    <pre class="json"><code id="execution-response-content-POSTadmin-sign-in"></code></pre>
</div>
<div id="execution-error-POSTadmin-sign-in" hidden>
    <blockquote>Request failed with error:</blockquote>
    <pre><code id="execution-error-message-POSTadmin-sign-in"></code></pre>
</div>
<form id="form-POSTadmin-sign-in" data-method="POST" data-path="admin/sign-in" data-authed="0" data-hasfiles="0" data-headers='{"Content-Type":"application\/json","Accept":"application\/json"}' onsubmit="event.preventDefault(); executeTryOut('POSTadmin-sign-in', 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-POSTadmin-sign-in" onclick="tryItOut('POSTadmin-sign-in');">Try it out ⚡</button>
    <button type="button" style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-canceltryout-POSTadmin-sign-in" onclick="cancelTryOut('POSTadmin-sign-in');" hidden>Cancel</button>&nbsp;&nbsp;
    <button type="submit" style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-executetryout-POSTadmin-sign-in" hidden>Send Request 💥</button>
    </h3>
<p>
<small class="badge badge-black">POST</small>
 <b><code>admin/sign-in</code></b>
</p>
<h4 class="fancy-heading-panel"><b>Body Parameters</b></h4>
<p>
<b><code>email</code></b>&nbsp;&nbsp;<small>string</small>  &nbsp;
<input type="text" name="email" data-endpoint="POSTadmin-sign-in" data-component="body" required  hidden>
<br>
Email associated with account. Ex: john_does@yopmail.com
</p>
<p>
<b><code>password</code></b>&nbsp;&nbsp;<small>string</small>  &nbsp;
<input type="password" name="password" data-endpoint="POSTadmin-sign-in" data-component="body" required  hidden>
<br>
Password. Ex: Ems016@2020
</p>

</form>


## Sign Out

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

Use this end point to sign out.

> Example request:

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


> Example response (200):

```json
{
    "message": "Sign out successfull!"
}
```
<div id="execution-results-GETadmin-sign-out" hidden>
    <blockquote>Received response<span id="execution-response-status-GETadmin-sign-out"></span>:</blockquote>
    <pre class="json"><code id="execution-response-content-GETadmin-sign-out"></code></pre>
</div>
<div id="execution-error-GETadmin-sign-out" hidden>
    <blockquote>Request failed with error:</blockquote>
    <pre><code id="execution-error-message-GETadmin-sign-out"></code></pre>
</div>
<form id="form-GETadmin-sign-out" data-method="GET" data-path="admin/sign-out" data-authed="1" data-hasfiles="0" data-headers='{"Authorization":"Bearer {YOUR_AUTH_KEY}","Content-Type":"application\/json","Accept":"application\/json"}' onsubmit="event.preventDefault(); executeTryOut('GETadmin-sign-out', 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-GETadmin-sign-out" onclick="tryItOut('GETadmin-sign-out');">Try it out ⚡</button>
    <button type="button" style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-canceltryout-GETadmin-sign-out" onclick="cancelTryOut('GETadmin-sign-out');" hidden>Cancel</button>&nbsp;&nbsp;
    <button type="submit" style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-executetryout-GETadmin-sign-out" hidden>Send Request 💥</button>
    </h3>
<p>
<small class="badge badge-green">GET</small>
 <b><code>admin/sign-out</code></b>
</p>
<p>
<label id="auth-GETadmin-sign-out" hidden>Authorization header: <b><code>Bearer </code></b><input type="text" name="Authorization" data-prefix="Bearer " data-endpoint="GETadmin-sign-out" data-component="header"></label>
</p>
</form>


## Admin Verify OTP


Use this end point to verify OTP for admin portal

> Example request:

```bash
curl -X POST \
    "https://apiqa.bettorfantasy.com/admin/verify-otp" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"email":"nemo","otp":"voluptatem"}'

```


> Example response (200):

```json
{
    "message": "Sign in successfull",
    "data": {
        "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC8xMjcuMC4wLjE6ODAwMFwvYWRtaW5cL3ZlcmlmeS1vdHAiLCJpYXQiOjE2NjEzMjMyNTgsImV4cCI6MTY5Mjg1OTI1OCwibmJmIjoxNjYxMzIzMjU4LCJqdGkiOiI1NnI0VjRwcUJhUVo2NHNoIiwic3ViIjoxLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.-1u-aTU1_dCox95RM_83K7TqPoDt3M3Gf1RxpRwxCdE",
        "token_type": "bearer",
        "expires_in": 31536000,
        "user": {
            "id": 1,
            "email": "admin@bettorfantasy.com",
            "username": "admin"
        }
    }
}
```
> Example response (422):

```json
{
    "message": "Please enter required information",
    "errors": {
        "otp": [
            "Verification code is invalid"
        ]
    }
}
```
<div id="execution-results-POSTadmin-verify-otp" hidden>
    <blockquote>Received response<span id="execution-response-status-POSTadmin-verify-otp"></span>:</blockquote>
    <pre class="json"><code id="execution-response-content-POSTadmin-verify-otp"></code></pre>
</div>
<div id="execution-error-POSTadmin-verify-otp" hidden>
    <blockquote>Request failed with error:</blockquote>
    <pre><code id="execution-error-message-POSTadmin-verify-otp"></code></pre>
</div>
<form id="form-POSTadmin-verify-otp" data-method="POST" data-path="admin/verify-otp" data-authed="0" data-hasfiles="0" data-headers='{"Content-Type":"application\/json","Accept":"application\/json"}' onsubmit="event.preventDefault(); executeTryOut('POSTadmin-verify-otp', 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-POSTadmin-verify-otp" onclick="tryItOut('POSTadmin-verify-otp');">Try it out ⚡</button>
    <button type="button" style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-canceltryout-POSTadmin-verify-otp" onclick="cancelTryOut('POSTadmin-verify-otp');" hidden>Cancel</button>&nbsp;&nbsp;
    <button type="submit" style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-executetryout-POSTadmin-verify-otp" hidden>Send Request 💥</button>
    </h3>
<p>
<small class="badge badge-black">POST</small>
 <b><code>admin/verify-otp</code></b>
</p>
<h4 class="fancy-heading-panel"><b>Body Parameters</b></h4>
<p>
<b><code>email</code></b>&nbsp;&nbsp;<small>string</small>  &nbsp;
<input type="text" name="email" data-endpoint="POSTadmin-verify-otp" data-component="body" required  hidden>
<br>
Email associated with account. Ex: john_does@yopmail.com
</p>
<p>
<b><code>otp</code></b>&nbsp;&nbsp;<small>string</small>  &nbsp;
<input type="text" name="otp" data-endpoint="POSTadmin-verify-otp" data-component="body" required  hidden>
<br>
Verification code. Ex: 2633
</p>

</form>


## Admin Resend OTP


Use this end point to resend OTP for admin portal

> Example request:

```bash
curl -X POST \
    "https://apiqa.bettorfantasy.com/admin/resend-otp" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"email":"voluptas"}'

```


> Example response (200):

```json
{
    "message": "OTP sent!"
}
```
> Example response (422):

```json
{
    "message": "Please enter required information",
    "errors": {
        "email": [
            "The email field is required."
        ]
    }
}
```
<div id="execution-results-POSTadmin-resend-otp" hidden>
    <blockquote>Received response<span id="execution-response-status-POSTadmin-resend-otp"></span>:</blockquote>
    <pre class="json"><code id="execution-response-content-POSTadmin-resend-otp"></code></pre>
</div>
<div id="execution-error-POSTadmin-resend-otp" hidden>
    <blockquote>Request failed with error:</blockquote>
    <pre><code id="execution-error-message-POSTadmin-resend-otp"></code></pre>
</div>
<form id="form-POSTadmin-resend-otp" data-method="POST" data-path="admin/resend-otp" data-authed="0" data-hasfiles="0" data-headers='{"Content-Type":"application\/json","Accept":"application\/json"}' onsubmit="event.preventDefault(); executeTryOut('POSTadmin-resend-otp', 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-POSTadmin-resend-otp" onclick="tryItOut('POSTadmin-resend-otp');">Try it out ⚡</button>
    <button type="button" style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-canceltryout-POSTadmin-resend-otp" onclick="cancelTryOut('POSTadmin-resend-otp');" hidden>Cancel</button>&nbsp;&nbsp;
    <button type="submit" style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-executetryout-POSTadmin-resend-otp" hidden>Send Request 💥</button>
    </h3>
<p>
<small class="badge badge-black">POST</small>
 <b><code>admin/resend-otp</code></b>
</p>
<h4 class="fancy-heading-panel"><b>Body Parameters</b></h4>
<p>
<b><code>email</code></b>&nbsp;&nbsp;<small>string</small>  &nbsp;
<input type="text" name="email" data-endpoint="POSTadmin-resend-otp" data-component="body" required  hidden>
<br>
Email associated with account. Ex: john_does@yopmail.com
</p>

</form>



