API

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

{% if user['auth'] %}

<div class="container-fluid">
{% else %}
<div class="container noneAuth">
{% endif %}
<div class="grid-container">
<div class="col-span-12">

<div class="page-title">
<i class="fad fa-display-code"></i>
<span>{{ page['title'] }}</span>
</div>
<table class="table table-bordered">
<tbody>
<tr>
<td class="width-40">HTTP Method</td>
<td>POST</td>
</tr>
<tr>
<td>API URL</td>
<td>{{site['protocol']}}://{{site['domain']}}/api/v2</td>
</tr>
{% if user['auth'] %}
<tr>
<td>API Key</td>
<td>Get an API key on the <a
href="{{site['protocol']}}://{{site['domain']}}/account">Account</a> page</td>
</tr>
{% endif %}
<tr>
<td>Response format</td>
<td>JSON</td>
</tr>
</tbody>
</table>

{% for method,methodDetails in methods %}


<h4 class="m-t-md"><strong>{{methodDetails['title']}}</strong></h4>
{% if 'add' == method %}
{% if methodDetails['types']|length > 1 %}
<p>
<form class="form-inline">
<div class="form-group">
<select class="form-control all-dropdown" id="service_type">
{% for type,label in methodDetails['types'] %}
<option value="{{type}}">{{label}}</option>
{% endfor %}
</select>
</div>
</form>
</p>
{% endif %}
{% for type,parameters in methodDetails['parameters'] %}
<div id="type_{{type}}" style="display:none;">
<table class="table table-bordered">
<thead>
<tr>
<th class="width-40">Parameters</th>
<th>Description</th>
</tr>
</thead>
<tbody>
{% for parameter,label in parameters %}
<tr>
<td>{{parameter}}</td>
<td>{{label}}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endfor %}
{% else %}
<table class="table table-bordered">
<thead>
<tr>
<th class="width-40">Parameters</th>
<th>Description</th>
</tr>
</thead>
<tbody>
{% for parameter,label in methodDetails['parameters'] %}
<tr>
<td>{{parameter}}</td>
<td>{{label}}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}

<p><strong>Example response</strong></p>

<div class="api-container">
<div class="code-block-top">
<span>RESPONSE</span>
<span class="code-block-right">JSON</span>
</div>
<pre><code class="hljs json">{{methodDetails['examples']}}</code></pre>
</div>
{% endfor %}
<a href="/example.txt" class="btn btn-main mt10 btn-min border-10"
target="_blank">Example of PHP code</a>
</div>
</div>
<script>hljs.highlightAll();

</script>

You might also like