<?php require view('theme/header'); ?>

<div class="container">
	<div class="row">
		<div class="col-md-8 col-md-offset-2">
			<div class="panel panel-default mt">
				<div class="panel-heading">API Docs</div>
				<div class="panel-body">
					<table class="table table-bordered">
						<tbody>
							<tr>
								<td>HTTP Method</td>
								<td>POST</td>
							</tr>
							<tr>
								<td>API URL</td>
								<td>{API_URL}</td>
							</tr>
							<tr>
								<td>API Key</td>
								<?php if(session('user_id')): ?>
								<td>{USER_API_KEY}</td>
								<?php else: ?>
								<td>Your API key</td>
								<?php endif;?>
							</tr>
							<tr>
								<td>Response format</td>
								<td>JSON</td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
			<div class="panel panel-default">
				<div class="panel-heading">Service List</div>
				<div class="panel-body">
					<table class="table table-bordered">
						<thead>
							<tr>
								<th>Parameters</th>
								<th>Description</th>
							</tr>
						</thead>
						<tbody>
							<tr>
								<td>key</td>
								<td>Your API key</td>
							</tr>
							<tr>
								<td>action</td>
								<td>services</td>
							</tr>
						</tbody>
					</table>
					<small><strong>Example response</strong></small>
<pre class="bg-dark text-white rounded p-2 small">
[
    {
        "service": 1,
        "name": "Followers",
        "type": "Default",
        "category": "First Category",
        "rate": "0.90",
        "min": "50",
        "max": "10000"
    },
    {
        "service": 2,
        "name": "Comments",
        "type": "Custom Comments",
        "category": "Second Category",
        "rate": "8",
        "min": "10",
        "max": "1500"
    }
]
</pre>
				</div>
			</div>
			<div class="panel panel-default">
				<div class="panel-heading">Add Order</div>
				<div class="panel-body">
					<form class="form-inline mb-2">
							<div class="form-group">
								<select class="form-control form-control-sm" id="service_type">
									<option value="0">Default</option>
									<option value="1">Package</option>
									<option value="2">Custom Comments</option>
									<option value="3">Subscriptions</option>
								</select>
							</div>
						</form>
						<div id="type_0">
							<table class="table table-bordered">
								<thead>
									<tr>
										<th>Parameters</th>
										<th>Description</th>
									</tr>
								</thead>
								<tbody>
									<tr>
										<td>key</td>
										<td>Your API key</td>
									</tr>
									<tr>
										<td>action</td>
										<td>add</td>
									</tr>
									<tr>
										<td>service</td>
										<td>Service ID</td>
									</tr>
									<tr>
										<td>link</td>
										<td>Link to page</td>
									</tr>
									<tr>
										<td>quantity</td>
										<td>Needed quantity</td>
									</tr>
									<tr>
										<td>runs (optional)</td>
										<td>Runs to deliver</td>
									</tr>
									<tr>
										<td>interval (optional)</td>
										<td>Interval in minutes</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div id="type_1" style="display: none;">
							<table class="table table-bordered">
								<thead>
									<tr>
										<th>Parameters</th>
										<th>Description</th>
									</tr>
								</thead>
								<tbody>
									<tr>
										<td>key</td>
										<td>Your API key</td>
									</tr>
									<tr>
										<td>action</td>
										<td>add</td>
									</tr>
									<tr>
										<td>service</td>
										<td>Service ID</td>
									</tr>
									<tr>
										<td>link</td>
										<td>Link to page</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div id="type_2" style="display: none;">
							<table class="table table-bordered">
								<thead>
									<tr>
										<th>Parameters</th>
										<th>Description</th>
									</tr>
								</thead>
								<tbody>
									<tr>
										<td>key</td>
										<td>Your API key</td>
									</tr>
									<tr>
										<td>action</td>
										<td>add</td>
									</tr>
									<tr>
										<td>service</td>
										<td>Service ID</td>
									</tr>
									<tr>
										<td>link</td>
										<td>Link to page</td>
									</tr>
									<tr>
										<td>comments</td>
										<td>Comments list separated by \r\n or \n</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div id="type_3" style="display: none;">
							<table class="table table-bordered">
								<thead>
									<tr>
										<th>Parameters</th>
										<th>Description</th>
									</tr>
								</thead>
								<tbody>
									<tr>
										<td>key</td>
										<td>Your API key</td>
									</tr>
									<tr>
										<td>action</td>
										<td>add</td>
									</tr>
									<tr>
										<td>service</td>
										<td>Service ID</td>
									</tr>
									<tr>
										<td>username</td>
										<td>Username</td>
									</tr>
									<tr>
										<td>quantity</td>
										<td>Needed quantity</td>
									</tr>
									<tr>
										<td>limit (optional)</td>
										<td>Post limit</td>
									</tr>
									<tr>
										<td>expiry (optional)</td>
										<td>Expiry date. Format d/m/Y</td>
									</tr>
								</tbody>
							</table>
						</div>
						<small><strong>Example response</strong></small>
<pre class="bg-dark text-white rounded p-2 small">
{
    "order": 23501
}
</pre>
				</div>
			</div>
			<div class="panel panel-default">
				<div class="panel-heading">Order Status</div>
				<div class="panel-body">
					<table class="table table-bordered">
							<thead>
								<tr>
									<th>Parameters</th>
									<th>Description</th>
								</tr>
							</thead>
							<tbody>
								<tr>
									<td>key</td>
									<td>Your API key</td>
								</tr>
								<tr>
									<td>action</td>
									<td>status</td>
								</tr>
								<tr>
									<td>order</td>
									<td>Order ID</td>
								</tr>
							</tbody>
						</table>
						<small><strong>Example response</strong></small>
<pre class="bg-dark text-white rounded p-2 small">
{
    "charge": "0.27819",
    "start_count": "3572",
    "status": "Partial",
    "remains": "157",
    "currency": "USD"
}
</pre>
				</div>
			</div>
			<div class="panel panel-default">
				<div class="panel-heading">Multiple Order Status</div>
				<div class="panel-body">
					<table class="table table-bordered">
							<thead>
								<tr>
									<th>Parameters</th>
									<th>Description</th>
								</tr>
							</thead>
							<tbody>
								<tr>
									<td>key</td>
									<td>Your API key</td>
								</tr>
								<tr>
									<td>action</td>
									<td>status</td>
								</tr>
								<tr>
									<td>orders</td>
									<td>Order IDs separated by comma</td>
								</tr>
							</tbody>
						</table>
						<small><strong>Example response</strong></small>
<pre class="bg-dark text-white rounded p-2 small">
{
    "1": {
        "charge": "0.27819",
        "start_count": "3572",
        "status": "Partial",
        "remains": "157",
        "currency": "USD"
    },
    "10": {
        "error": "Incorrect order ID"
    },
    "100": {
        "charge": "1.44219",
        "start_count": "234",
        "status": "In progress",
        "remains": "10",
        "currency": "USD"
    }
}
</pre>
				</div>
			</div>
			<div class="panel panel-default">
				<div class="panel-heading">User Balance</div>
				<div class="panel-body">
					<table class="table table-bordered">
							<thead>
								<tr>
									<th>Parameters</th>
									<th>Description</th>
								</tr>
							</thead>
							<tbody>
								<tr>
									<td>key</td>
									<td>Your API key</td>
								</tr>
								<tr>
									<td>action</td>
									<td>balance</td>
								</tr>
							</tbody>
						</table>
						<small><strong>Example response</strong></small>
<pre class="bg-dark text-white rounded p-2 small">
{
    "balance": "100.84292",
    "currency": "USD"
}
</pre>
				</div>
			</div>
<?php require view('theme/footer'); ?>