| Current Path : /home/users/unlimited/www/facebook.codeskitter.site/themes/wowonder/layout/graph/ |
| Current File : /home/users/unlimited/www/facebook.codeskitter.site/themes/wowonder/layout/graph/content.phtml |
<div class="page-margin">
<div class="row wo_my_pages">
<div class="col-md-12"><?php echo Wo_LoadPage('graph/sidebar') ?></div>
<div class="col-md-12">
<div class="page-margin wow_content">
<div class="setting-well">
<p>Our API allows you to retrieve informations from our website via GET request and supports the following query parameters: </p>
<div class="table-responsive">
<table class="table table-bordered developer_get_req">
<thead>
<tr>
<th><span class="btn-default">Name</span></th>
<th><span class="btn-default">Meaning</span></th>
<th><span class="btn-default">Values</span></th>
<th><span class="btn-default">Description</span></th>
<th><span class="btn-default">Required</span></th>
</tr>
</thead>
<tbody>
<tr>
<td><b>type</b></td>
<td>Query type.</td>
<td>get_user_data, posts_data, get_pages, get_groups, get_products, get_followers, get_following, get_friends</td>
<td>This parameter specify the type of the query.</td>
<td><svg id="Layer_1" enable-background="new 0 0 512 512" height="20" viewBox="0 0 512 512" width="20" xmlns="http://www.w3.org/2000/svg"><g clip-rule="evenodd" fill-rule="evenodd"><path d="m256 0c-141.2 0-256 114.8-256 256s114.8 256 256 256 256-114.8 256-256-114.8-256-256-256z" fill="#4bae4f"/><path d="m379.8 169.7c6.2 6.2 6.2 16.4 0 22.6l-150 150c-3.1 3.1-7.2 4.7-11.3 4.7s-8.2-1.6-11.3-4.7l-75-75c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l63.7 63.7 138.7-138.7c6.2-6.3 16.4-6.3 22.6 0z" fill="#fff"/></g></svg></td>
</tr>
<tr>
<td><b>limit</b></td>
<td>Limit of items.</td>
<td>LIMIT</td>
<td>This parameter specify the limit of items. Max:100 | Default:20</td>
<td><svg id="Layer_1" enable-background="new 0 0 512 512" height="20" viewBox="0 0 512 512" width="20" xmlns="http://www.w3.org/2000/svg"><g clip-rule="evenodd" fill-rule="evenodd"><path d="m256 0c-141.2 0-256 114.8-256 256s114.8 256 256 256 256-114.8 256-256-114.8-256-256-256z" fill="#f34235"/><path d="m346.9 346.9c-6.2 6.2-16.4 6.2-22.6 0l-68.3-68.3-68.2 68.3c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6l68.3-68.2-68.3-68.2c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l68.2 68.2 68.2-68.2c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6l-68.2 68.1 68.2 68.2c6.3 6.3 6.3 16.4.1 22.7z" fill="#fff"/></g></svg></td>
</tr>
</tbody>
</table>
</div>
<br>
<div style="font-size:18px;">How to start?</div>
<hr>
<ol style="list-style: initial;">
<li>Create a <a href="<?php echo Wo_SeoLink('index.php?link1=create-app');?>" class="main">development application</a>.<br><br></li>
<li>Once you have created the app, you'll get APP_ID, and APP_SECRET. <br>Example: <br><br> <img src="<?php echo $wo['config']['theme_url'];?>/img/developer.png" alt=""><br><br></li>
<li>To start the Oauth process, use the link <?php echo $wo['config']['site_url'] ?>/oauth?app_id={YOUR_APP_ID}<br><br></li>
<li>Once the end user clicks this link, he/she will be redirected to the authorization page.<br><br></li>
<li>Once the end user authorization the app, he/she will be redirected to your domain name with a GET parameter "code", example: http://yourdomain/?code=XXX<br><br></li>
<li>
In your code, to retrieve the authorized user info, you need to generate an access code, please use the code below:<br><br>
<ol style="list-style: initial;">
<li>
PHP:
<code>
<?php
$code = '<?php
$app_id = \'YOUR_APP_ID\'; // your application app id
$app_secret = \'YOUR_APP_SECRET\'; your application app secret
$code = $_GET[\'code\']; // the GET parameter you got in the callback: http://yourdomain/?code=XXX
$get = file_get_contents("' . $wo['config']['site_url'] . '/authorize?app_id={$app_id}&app_secret={$app_secret}&code={$code}");
$json = json_decode($get, true);
if (!empty($json[\'access_token\'])) {
$access_token = $json[\'access_token\']; // your access token
}
?>';
echo '
<pre>' . htmlspecialchars($code) . '</pre>
';
?>
</code>
</li>
</ol>
</li>
<li>
Once you got the access code, simple call the data you would like to retrieve, Example: <br><br>
<ol style="list-style: initial;">
<li>PHP:
<code>
<?php
$code = 'if (!empty($json[\'access_token\'])) {
$access_token = $json[\'access_token\']; // your access token
$type = "get_user_data"; // or posts_data
$get = file_get_contents("' . $wo['config']['site_url'] . '/app_api?access_token={$access_token}&type={$type}");
}
';
echo '<pre>' . htmlspecialchars($code) . '</pre>';
?>
</code>
</li>
<li>
Respond:
<pre>
<b>Json</b>output
{
"api_status": "success",
"api_version": "1.3",
"user_data": {
"id": "",
"username": "",
"first_name": "",
"last_name": "",
"gender": "",
"birthday": "",
"about": "",
"website": "",
"facebook": "",
"twitter": "",
"vk": "",
"google+": "",
"profile_picture": "",
"cover_picture": "",
"verified": "",
"url": ""
}
}
</pre>
</li>
</ol>
</li>
</ol>
</div>
</div>
</div>
</div>
</div>