+ Reply to Thread
Results 1 to 3 of 3
Thread: Help with fetchTrends()
-
03-11-2012 01:43 PM #1Member
- Join Date
- May 2011
- Posts
- 90
Help with fetchTrends()
Hi,
I was testing the "example" below but it doesn't return any values.
PHP Code:require_once('class/Prosperent_Api.php');
$prosperentApi = new Prosperent_Api(array(
'filterMerchant' => 'Zappos'
));
//fetch the result
$prosperentApi->fetchTrends();
//iterate through the facets response
echo '<table border="1">';
$i=0;
foreach ($prosperentApi->getFacets('merchant') as $row)
{
/*
* if this is the first row, set the titles
*/
if ($i++ == 0)
{
echo '<tr>';
foreach (array_keys($row) as $th)
{
echo '<th>' . $th . '</th>';
}
echo '</tr>';
}
echo '<tr>';
foreach ($row as $value)
{
echo '<td>' . substr($value, 0, 50) . '</td>';
}
echo '</tr>';
}
echo '</table>';
-
03-11-2012 02:35 PM #2
When calling the API with fetchTrends() make sure you add the commissionDateRange parameter as it is required.
Example:
PHP Code:require_once('class/Prosperent_Api.php');
$prosperentApi = new Prosperent_Api(array(
'filterMerchant' => 'Zappos',
'commissionDateRange' => 20120110
));
-
03-11-2012 02:37 PM #3Member
- Join Date
- May 2011
- Posts
- 90
Got it!

Reply With Quote