Welcome to mirror list, hosted at ThFree Co, Russian Federation.

api_internal_call.php « misc - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 99486cf87203e898ff683d327aaa1b948f37cdb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
define('PIWIK_INCLUDE_PATH', '..');
define('ENABLE_DISPATCH', false);	
require_once PIWIK_INCLUDE_PATH . "/index.php";
require_once PIWIK_INCLUDE_PATH . "/modules/API/Request.php";

// We call the API from a php code
// it will check that you have the necessary rights
// - either you are loggued in piwik and have a cookie in your browser
// - or you will have to add the token_auth=XXX to the request string to authenticate
//   beware that the token_auth changes every time you change your password
$request = new Piwik_API_Request('
			method=UserSettings.getResolution
			&idSite=1
			&date=yesterday
			&period=week
			&format=XML
			&filter_limit=3
');
$result = $request->process();
echo $result;

?>