Closed flashbng closed 9 years ago
When I turn on de-bugging, it looks like it's trying to send a POST request to a moved document:
send POST request: https://api.omniture.com/admin/1.4/rest/?method=Report.QueueOvertime
Anyone looking at this at all? Would be nice to get some feedback from the "official" SDK.
This SDK currently only supports 1.3
. The Report.QueueOvertime
method for 1.4
has been changed to Report.Queue
.
One way to get around this is to use the SuiteApi
class instead of the ReportApi
class. The SuiteApi
class is a generic class that can call any 1.4
method easily. This should work for 1.4
:
$api = $adm->getSuiteApi();
$response = $api->post('Report.Queue', array('reportDescription' => array(
'reportSuiteID' => 'xxxxxx',
'dateFrom' => date($start_date),
'dateTo' => date($end_date),
'metrics' => array(
array('id' => 'visits'),
),
'segments' => '',
)));
var_dump($response);
#fetch response from query
$reportId = $response['reportID'];
do {
$report = $api->post('Report.Get', array('reportID' => $reportId));
sleep(2);
} while (isset($report['error_description']) && $report['error_description'] == 'report_not_ready');
var_dump($report);
@bshaffer Thank you a ton!
@bshaffer -- found a small error in the code you provided.
This:
do {
$report = $api->post('Report.Get', array('reportID' => $reportId));
sleep(2);
} while (isset($report['error_description']) && $report['error_description'] == 'report_not_ready')
Needs to be this:
do {
$report = $api->post('Report.Get', array('reportID' => $reportId));
sleep(2);
} while (isset($report['error_description']) && $report['error_description'] == 'Report not ready');
The newest version now supports v1.4 by default
I'm currently having problems with querying V1.4 of the Omniture API using this SDK, although V1.3 works just fine. Reason for the upgrade is I'm trying to utilize the ability to stack segments in the API.
When I comment out the V1.4 option, both of the var_dumps return and give me everything I need. However, when I use the option, I get NULL for both.
Any thoughts? Code I'm using is below.