I am struggling to find enough info to be able to successfully add a scheduled report. The documentation for ScheduledReports.addReport has no examples.
In my test script, that I got working as the example PHP to fetch keywords , I adapted sing the spec for ScheduledReports.addReport and looking at data (API key etc removed) I created the script below, but it doesn’t do anything.
I drove my argument data from what IO could see in the database ‘report’ table but I am pretty much guessing how the two query strings for
reports and parameters might be formatted.
For reports I saw in the API documentation arrays as query string parameters, so used report[0] etc, but for parameters I am guessing.
So can anyone with some experience of this give me a pointer. Thanks
(script below has had API / domain / email removed of course to protect the innocent)
So anyone know the correct way of specifying an array within an array in a query string?
There is an error. Please report the message (Piwik 2.1.0) and full backtrace in the Piwik forums (please do a Search first as it might have been reported already!).
Warning: Invalid argument supplied for foreach() in /home/llocally/domains/analytics.llocally.info/public_html/plugins/ScheduledReports/ScheduledReports.php on line 593
Backtrace -->
#0 Piwik\Error::errorHandler(...) called at [/home/llocally/domains/analytics.llocally.info/public_html/plugins/ScheduledReports/ScheduledReports.php:593]
#1 Piwik\Plugins\ScheduledReports\ScheduledReports::checkAdditionalEmails(...) called at [/home/llocally/domains/analytics.llocally.info/public_html/plugins/ScheduledReports/ScheduledReports.php:158]
#2 Piwik\Plugins\ScheduledReports\ScheduledReports->validateReportParameters(...) called at [:]
#3 call_user_func_array(...) called at [/home/llocally/domains/analytics.llocally.info/public_html/core/EventDispatcher.php:98]
#4 Piwik\EventDispatcher->postEvent(...) called at [/home/llocally/domains/analytics.llocally.info/public_html/core/Piwik.php:778]
#5 Piwik\Piwik::postEvent(...) called at [/home/llocally/domains/analytics.llocally.info/public_html/plugins/ScheduledReports/API.php:631]
#6 Piwik\Plugins\ScheduledReports\API::validateReportParameters(...) called at [/home/llocally/domains/analytics.llocally.info/public_html/plugins/ScheduledReports/API.php:84]
#7 Piwik\Plugins\ScheduledReports\API->addReport(...) called at [:]
#8 call_user_func_array(...) called at [/home/llocally/domains/analytics.llocally.info/public_html/core/API/Proxy.php:209]
#9 Piwik\API\Proxy->call(...) called at [/home/llocally/domains/analytics.llocally.info/public_html/core/API/Request.php:215]
#10 Piwik\API\Request->process(...) called at [/home/llocally/domains/analytics.llocally.info/public_html/plugins/API/Controller.php:31]
#11 Piwik\Plugins\API\Controller->index(...) called at [:]
#12 call_user_func_array(...) called at [/home/llocally/domains/analytics.llocally.info/public_html/core/FrontController.php:521]
#13 Piwik\FrontController->doDispatch(...) called at [/home/llocally/domains/analytics.llocally.info/public_html/core/FrontController.php:84]
#14 Piwik\FrontController->dispatch(...) called at [/home/llocally/domains/analytics.llocally.info/public_html/core/dispatch.php:30]
#15 require_once(...) called at [/home/llocally/domains/analytics.llocally.info/public_html/index.php:47]