Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

call same API by different way got different result #11575

Closed
Shengzhi-Wang opened this issue Apr 1, 2017 · 3 comments
Closed

call same API by different way got different result #11575

Shengzhi-Wang opened this issue Apr 1, 2017 · 3 comments
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@Shengzhi-Wang
Copy link

hello,

i found an issue which is same API call got different result when called by different ways.

one way:
$data = \Piwik\API\Request::processRequest('Live.getLastVisitsDetails', array(
'idSite' => $idSite,
'period' => $period,
'date' => $date,
'segment' => $segment
));

another way:
$data2= \Piwik\Plugins\Live\API::getInstance()->getLastVisitsDetails($idSite, $period, $date, $segment);

$data2 has 75 rows, but $data1 has 52 rows.
Right now I just find it in Live.getLastVisitsDetails API.
It seems that I use the same API. why $data is different with $data2?

Thanks,

@tsteur
Copy link
Member

tsteur commented Apr 1, 2017

Which URL do you use to call the first way? Any URL parameter will be also used in the API call and could change the result.

@xiaotaozi1127
Copy link

i am in the same team with shengzhi.
@tsteur, what do you mean for URL parameter? we only pass idSite, period, date and segment parameters.

@tsteur
Copy link
Member

tsteur commented Apr 2, 2017

The PHP script that calls \Piwik\API\Request::processRequest(...) do you call that? On command line? Or via HTTP? If via HTTP, with with URL parameters in the URL?

@mattab mattab closed this as completed May 8, 2017
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label May 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

4 participants