Web Services Examples - listApkScreens GET::JSON Response
<?php
//Web Service needed arguments
$repo = 'my-repository'; //Repository name
$apkid = 'com.android.myapp'; //Application package ID
$apkversion = '1.0.0'; //Application version
$mode = 'json';
//Using the Web Service
$request = 'https://webservices.aptoide.com/webservices/listApkScreens/'.
$repo.'/'.$apkid.'/'.$apkversion.'/'.$mode;
$response = file_get_contents($request);
$jsonobj = json_decode($response); //JSON Object
//Retrieve the data from the JSON if 'OK'
// (in this case we're using a simple table to show the contents as an example)
if ($jsonobj->status == 'OK'){
//Create table header
echo '<table>';
echo '<th>Screenshots</th>';
//Build data table
foreach($jsonobj->listing as $row){
echo '<tr><td><img src="'.$row.'" /></td></tr>';
}
echo '</table>';
} else {
//On 'FAIL': Show the error message
echo 'Retrieving listApkScreens JSON failed!<br />';
echo 'Error log:<br />';
foreach($jsonobj->errors as $errlog){
echo $errlog.'<br />';
}
}
?>
//Web Service needed arguments
$repo = 'my-repository'; //Repository name
$apkid = 'com.android.myapp'; //Application package ID
$apkversion = '1.0.0'; //Application version
$mode = 'json';
//Using the Web Service
$request = 'https://webservices.aptoide.com/webservices/listApkScreens/'.
$repo.'/'.$apkid.'/'.$apkversion.'/'.$mode;
$response = file_get_contents($request);
$jsonobj = json_decode($response); //JSON Object
//Retrieve the data from the JSON if 'OK'
// (in this case we're using a simple table to show the contents as an example)
if ($jsonobj->status == 'OK'){
//Create table header
echo '<table>';
echo '<th>Screenshots</th>';
//Build data table
foreach($jsonobj->listing as $row){
echo '<tr><td><img src="'.$row.'" /></td></tr>';
}
echo '</table>';
} else {
//On 'FAIL': Show the error message
echo 'Retrieving listApkScreens JSON failed!<br />';
echo 'Error log:<br />';
foreach($jsonobj->errors as $errlog){
echo $errlog.'<br />';
}
}
?>