Файл: Script/themes/dolphin/html/page/api.html
Строк: 112
<?php
<div class="row-body{$content_class}">
<div class="nine columns" id="messages">
<div class="page-container">
<div class="page-content">
<div class="page-header">{$header}</div>
<div class="page-inner">
<div class="row">
Our API allows you to retrieve informations from our website via <strong>GET</strong> request and supports the following query parameters:
<br /><br />
<table border="1" width="100%">
<tr>
<td width="20%" valign="top">Name</td>
<td width="20%" valign="top">Meaning</td>
<td width="60%" valign="top">Description</td>
</tr>
<tr>
<td width="20%" valign="top"><strong>t (required)</strong></td>
<td width="20%" valign="top">Query type.</td>
<td width="60%" valign="top">This parameter specify the type of the query, <strong><code>u</code></strong> is for profile informations, <strong><code>m</code></strong> is for messages informations.</td>
</tr>
<tr>
<td width="20%" valign="top"><strong>q (required)</strong></td>
<td width="20%" valign="top">Requested <strong>username</strong>.</td>
<td width="60%" valign="top">The <code>t</code> parameter supports two values:
<ul>
<li>u = <strong>username</strong> [returns basic profile informations containing the following]
<ul>
<li><code>id</code> = returns the user Unique Id</li>
<li><code>username</code> = returns the Username</li>
<li><code>first_name</code> = returns the First Name</li>
<li><code>last_name</code> = returns the Last Name</li></li>
<li><code>website</code> = returns the website</li></li>
<li><code>location</code> = returns the location</li></li>
<li><code>image</code> = returns the profile avatar image</li></li>
<li><code>cover</code> = returns the profile cover image</li></li>
<li><code>verified</code> = returns whether user is verified or not [possible values: 0 (not verified); 1(verified);]</li></li>
</ul>
</li>
<li>m = <strong>username</strong> [returns a list of latest 20 message from an user containing the following]
<ul>
<li><code>id</code> = returns the Message Unique Id</li>
<li><code>by</code> = returns the User Unique Id</li>
<li><code>message</code> = returns the Message</li>
<li><code>type</code> = returns the Message Type [possible values: map; game; video; food; visited; movie; music;</li>
<li><code>time</code> = returns the date time when was published</li>
<li><code>likes</code> = returns the number of likes</li>
</ul>
</li>
</ul></td>
</tr>
</table>
<br />
<hr>
<div id="jump-url"><strong>Examples of requests:</strong></div><br />
For profile information from an user:
<br />
<code class="api-request">{$url}/api.php?t=u&q=USERNAME</code>
<br /><br />
For a list of latest 20 messages from an user:
<br />
<code class="api-request">{$url}/api.php?t=m&q=USERNAME</code>
<hr>
An example of <strong>json</strong> decoding would be the following PHP code:
<br /><br />
<code>
<?php<br />
header('Content-Type: text/plain; charset=utf-8;');
<br />
$file = file_get_contents("{$url}/api.php?t=m&q=USERNAME");<br />
print_r(json_decode($file));<br />
?>
</code>
<br />
</div>
</div>
</div>
</div>
</div>
<div class="three columns">
{$sidebar}
</div>
</div>
?>