@anonymous-piwik-user opened this Issue on June 12th 2013

Since the last version, I discovered a problem with API.

If I use:

$url = "http://www.domain.com/;
$url .= "?module=API&method=PDFReports.addReport";
$url .= "&idSite=1&description=Rapport&period=never&hour=0";
$url .= "&reportType=email&reportFormat=pdf";
$url .= "&reports[]=" . implode('&reports[]=',$types[$type]['reports']);
$url .= "&parameters[displayFormat]=" . $types[$type]['parameters']['displayFormat'];
$url .= "&parameters[emailMe]=" . $types[$type]['parameters']['emailMe'];
$url .= "&parameters[evolutionGraph]=" . $types[$type]['parameters']['evolutionGraph'];
$url .= "&format=JSON";
$url .= "&token_auth=" . ADMIN_TOKEN_AUTH;
$r= new Piwik_API_Request($url);
$request = $r->process();
print_r($request);

Result:

{"result":"error", "message":"Please specify a value for 'parameters'."}

If I use:

$url = "http://www.domain.com/";
$url .= "?module=API&method=PDFReports.addReport";
$url .= "&idSite=1&description=Rapport&period=never&hour=0";
$url .= "&reportType=email&reportFormat=pdf";
$url .= "&reports[]=" . implode('&reports[]=',$types[$type]['reports']);
$url .= "&parameters[displayFormat]=" . $types[$type]['parameters']['displayFormat'];
$url .= "&parameters[emailMe]=" . $types[$type]['parameters']['emailMe'];
$url .= "&parameters[evolutionGraph]=" . $types[$type]['parameters']['evolutionGraph'];
$url .= "&format=JSON";
$url .= "&token_auth=" . ADMIN_TOKEN_AUTH;
$request = json_decode(file_get_contents($url),true);
print_r($request);

Result:

Array
(
[value] => 12
)

Powered by GitHub Issue Mirror