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

I've created a new PHP script which calls Piwik_API_Request. I've included the token_auth variable in the call but I keep getting:

Array ( [result] => error [message] => You can't access this resource as it requires a 'view' access for the website id = 2. )

This is part of the code:

define('PIWIK_INCLUDE_PATH', '.');
define('ENABLE_DISPATCH', false);    
require_once PIWIK_INCLUDE_PATH . "/index.php";
require_once PIWIK_INCLUDE_PATH . "/modules/API/Request.php";


$request = new Piwik_API_Request ("method=VisitsSummary.get

$result = $request->process();


The call doesn't produce any error if I'm logged in.

@mattab commented on June 30th 2008 Member

Have you used the token that you get when you are logged in, by going to the API section?

It loooks like you are using a token from a user who doesn't have enough permission on this website. reopen if i'm wrong.

@anonymous-piwik-user commented on June 30th 2008

I use the tocken provided when I'm logged in as administrator.

This Issue was closed on March 19th 2010
Powered by GitHub Issue Mirror